Advisory

GHSA-49h3-cwhj-4737

Details, part 2 of 2. The advisory

Details

Remediation

  • Treat X-WOPI-SuggestedTarget (and X-WOPI-RequestedName) as a filename, not a path: reject /, \, dot segments, and percent-encoded separator variants before joining.
  • Prefer DirUri().Join(sanitizedBaseName) over JoinRaw, and after constructing the target URI assert it is a direct child of the source file's directory.
  • Add regression tests for a/../../evil.docx, sub/evil.docx, and encoded-separator variants.

Sources & licences