How to fix: Downloadable Content Served as inline
PDFs, Office documents, or other downloadable files are served with Content-Disposition: inline, causing them to render in the browser rather than download. Inline rendering exposes them to iframe-based data exfiltration.
Why it matters
An attacker who can embed your site in an iframe can extract text content from inline-rendered PDFs or documents via scroll-to-text-fragment attacks or timing side-channels.
Content-Disposition: inline tells the browser to render the file in the viewport. For sensitive documents, Content-Disposition: attachment forces a download instead, preventing browser rendering and reducing iframe-based exfiltration risk.
How to fix it
- 1Set Content-Disposition: attachment; filename="document.pdf" for sensitive downloads.
- 2Set Content-Disposition: inline only for content intended to render in the browser (e.g., images served in img tags).
Code examples
Next.js API route
return new Response(pdfBuffer, {
headers: {
'Content-Type': 'application/pdf',
'Content-Disposition': 'attachment; filename="report.pdf"',
},
});References
Detected automatically by VulnRadar. The check id is content-disposition-inline, stable across every scan so you can filter or diff on it.
More config checks
- MediumNo Rate-Limit Policy Detected
- MediumVary: Cookie Missing on Cookie-Bearing Response
- LowSet-Cookie Header Exceeds 4 KB
- LowVary Header Missing on Compressed Responses
- InfoX-XSS-Protection Header Is Deprecated
- LowServer-Timing Exposes Cache Timings
- LowVary: Cookie on Static Resource
- MediumCORS Endpoint Missing Vary: Origin
Questions
- How severe is Downloadable Content Served as inline?
- VulnRadar rates this info severity in the config category. The severity is fixed per check, not scored per site, so the same finding is the same severity on every scan.
- Does VulnRadar check for this automatically?
- Yes. It runs as part of every scan under the check id content-disposition-inline, which stays the same between runs so you can filter, diff, or gate CI on it.
- Which standards does Downloadable Content Served as inline map to?
- It maps to CWE-79. In the OWASP Top 10 it falls under A03:2021.
Missing a check?
The detection set is open. If you know a misconfiguration this does not catch, propose it: the issue template asks for the threat model, how to detect it, the false-positive risk, and a test fixture, which is the same thing a maintainer would have to work out anyway.