Facebook source code disclosure in ads API
The Facebook Ads API image upload endpoint did not properly handle exceptions when given a corrupted image or invalid base64 string, causing a PHP error that revealed internal file paths and stack traces. An attacker could send a crafted request to obtain this internal information.
Published on amolbaikar.com
Facebook Ads Manager allows users to create and publish ads to Facebook. When users upload their images using User Interface, Facebook uploads those Ad Images through Graph API in the owner’s adaccount.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the endpoint lacked proper exception handling for invalid image data, causing PHP errors to be returned to the user with internal stack traces.
Impact
This could have leaked some internal stack traces and exceptions.
What the attacker needed
Access to the ads API endpoint; ability to send POST requests
The fix
The issue was fixed according to the timeline.
How it was found
- Send a POST request to the adimages edge with a base64-encoded invalid image string.
- Observe the error response containing internal file paths and stack trace.
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 write-up has not been written yet. The Original tab links to the source.
When a program hits an unexpected error, it sometimes shows a detailed error message that includes internal details like file paths and function names. Here, the image upload feature showed such details when given bad image data. This is a problem because attackers can learn about the system's inner workings, which might help them plan further attacks.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.