The "Download Raw Diff" URL is viewable by everyone
A raw diff file created with restricted visibility could be accessed by anyone who knew its URL, without authentication. An attacker with the URL could view sensitive code changes that were meant to be visible only to administrators.
Originally disclosed on HackerOne
- Disclosed after under an hour
mongoose
This is similar to #213942, but less severe. Here is what you said in #213942:
The change makes us write files with narrow permissions (instead of broad permissions), write temporary files (instead of permanent files) and [...]
If I understand your comment correctly, suppose that an Administrator creates a diff and revision and sets its visibility to "Administrators", it means that non-admin users cannot view the raw diff via a URL generated by Phabricator, even if the URL is generated randomly, is it correct?
But here is what I find with repro steps:
- Log in an Phabricator account. Then go to http://phab.local/differential/diff/create
- Enter any raw diff. Change the "Visible to" to "Administrators". Click "Create Diff".
- Leave "Attach To" as "Create a new Revision...". Click "Continue".
- In the "Create Revision" page, change the "Visible to" to "Administrators" and "Editable By" to "Administrators". Click "Create New Revision".
- In the "Differential" page, click "Download Raw Diff" on the right. After the page is fully loaded, copy the URL.
- Open a new Private browser window (so that you are logged off). Visit the copied URL. You can see the raw diff, even if you are not logged in any account.
Although you are using a temporary files for the raw diff file, it's clear that there's no permission set to this file, because anyone with the URL can view it.
Impact
I can think of two attack scenarios:
-
Let's say that every developer in my team is in the same discussion group. I post a Raw Diff URL to the group. I think I am safe to do so because Phabricator should block non-admin from viewing it. But in reality, everyone, including less trusted members, has access to the restricted raw diff file. Note that there's no warning telling me not to share the URL.
-
Suppose there's a directory listing vulnerability on my server, an attacker can use that vulnerability together with this issue to read all raw diff files in the temp folders.
mongoose
Sincerely, Xiaoyin
Attachments

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
Root cause
Likely the raw diff file was stored without any access control check, so knowing the URL was enough to read it.
Impact
Anyone with the URL could view restricted raw diffs, potentially leaking sensitive code changes to unauthorised users.
What the attacker needed
Knowing the raw diff URL; no account needed
How it was found
- Log in and go to the diff creation page.
- Enter a raw diff and set visibility to Administrators, then create the diff.
- Continue to create a new revision, also setting visibility and editability to Administrators.
- On the revision page, click Download Raw Diff and copy the URL.
- Open a private browser window (logged out) and visit the copied URL.
- Observe that the raw diff is displayed without authentication.
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.
When you create a code diff in a tool like Phabricator, you can set who is allowed to see it. The report shows that the file containing the raw diff was stored in a way that anyone with the link could open it, even if they were not logged in. This means a secret link could leak the diff to people who should not see it.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.