Skip to content
Misconfiguration Write-up Intermediate

CVE-2021-29084: Exploiting CRLF Header Injection in Synology NAS for Unauthenticated File Downloads

An unauthenticated endpoint on a Synology NAS reflected a user-supplied path parameter into an HTTP redirect without sanitising CRLF characters, allowing header injection. By injecting an X-Accel-Redirect header, an attacker who knows a target filename could download files shared via SMB.

Justin Taft Follow

Published on justintaft.com

Recently my CVE-2021-29084 went public (ZDI Link). We thought it would be fun to share my disclosure notes.

Justin Taft, on justintaft.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 used snprintf to build a redirect string from the path parameter without stripping carriage-return and line-feed characters, so injected CRLF sequences created new HTTP headers.

What the attacker needed

Network access to the NAS web portal; knowledge of the target filename

How it was found

  1. Send a request to the SecurityAdvisor report endpoint with a path parameter containing CRLF sequences and observe the injected headers in the 302 response.
  2. Inject an X-Accel-Redirect header pointing at a file under a volume path that nginx serves internally.
  3. Receive the file contents in the response body.

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.

HTTP responses are made of a status line, headers (like 'Location:') and a body. If a web application puts user input into a header without removing newline characters, an attacker can add extra headers of their own. Here that let the attacker tell the web server (nginx) to serve a file from the NAS that was only meant to be shared locally.

What is Misconfiguration?

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.

More from Synology

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Security misconfiguration

The lesson behind this report.

Settings left unsafe: exposed panels, open storage buckets, debug modes, default credentials.