User can link non-public file attachments, leading to file disclose on edit by higher-privileged user
A lower-privileged user could reference a private file attachment in a public post; when a higher-privileged user edited that post, the file's permissions were silently updated to public, disclosing the private file. The attacker could then access the file.
- Fixed in 2.4 years
- Paid in 2.4 years
- Disclosed after 2.5 years
CVSS
Medium 6.5 CVSS:3.0/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N
Description
Uploaded files can be linked to from anywhere by referencing their ID. If the user viewing the reference to the file has permission to access the file, it will be rendered. Otherwise, the reference will be displayed as text.
If a user references a file from a private location in a public location, the file permissions will silently be updated and the file will be made available publicly as well (if the user has permission to access the file; otherwise, permissions will remain unchanged).
This behavior results in problems when a higher-privileged user edits the post of a lower-privileged user which contains a reference to a private file. The file will be disclosed publicly, without the user intending this or being aware of it.
POC
Setup:
- Create a private task (task is just one example, all components are affected by this):
/maniphest/-> create task -> Visible to / Editable by: administrators (or some other high-privileged group). - Add an attachment: leave a comment -> Upload file. Note the file ID.
Attack:
- With a lower-privileged user, create a public task (or some other component):
/maniphest/-> create task -> Include a reference to the private file in the description, eg ``. Include some formatting mistakes, typos, profanity, etc to entice a higher-privileged user into editing the post. - Wait for a higher-privileged user viewing the task. The user will see the file attachment resolve normally, edit the task and fix the formatting error. Nothing will indicate that a private file has been made public.
- After the user has edited the post, the file will be available to the lower-privileged user.
Impact
disclosure of private file attachments when a user with access to the attachment edits a post of a user without access to it.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Impact
A private file attachment could be disclosed publicly when a user with access to the attachment edits a post of a user without access to it.
What the attacker needed
A lower-privileged account; a higher-privileged user edits the post; a private file attachment exists
How it was found
- Create a private task visible only to administrators and add a file attachment, noting its ID.
- As a lower-privileged user, create a public task and include a reference to the private file in the description.
- Wait for a higher-privileged user to view the task; the file attachment resolves normally for them.
- The higher-privileged user edits the task to fix formatting errors, which silently makes the file public.
- After the edit, the file becomes available to the lower-privileged user.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Files have permissions that decide who can see them. This bug let someone trick a more powerful user into accidentally making a private file public just by editing a post that mentioned the file. The attacker could then read the file they were not supposed to see.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.