Skip to content
Info disclosure Write-up Beginner

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.

Amol Baikar Follow

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.

Amol Baikar (@AmolBaikar), on amolbaikar.com

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

  1. Send a POST request to the adimages edge with a base64-encoded invalid image string.
  2. 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.

More by Amol Baikar

View all

3 more disclosed reports, best first.

More from Meta

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Information disclosure

The lesson behind this report.

Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.