You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The second thing, The Filename escape requirements are then as follows
" --> %2F, "
\r --> %0D, \r
\n --> %0A, \n
The third thing,
This line is the process of "escaping the 'file name at download time' on the HTTP Response Header.
In other words, filepath is irrelevant.
(The part that actually reads the file is the following line (filepath) )
Issue Description
Return Response Header:
Cause & Fix
The first thing to escape is the filename
The second thing, The Filename escape requirements are then as follows
" --> %2F, "
\r --> %0D, \r
\n --> %0A, \n
The third thing,
This line is the process of "escaping the 'file name at download time' on the HTTP Response Header.
In other words, filepath is irrelevant.
(The part that actually reads the file is the following line (filepath) )
echo/context.go
Line 588 in 98a5237
Checklist
Expected behaviour
Actual behaviour
Steps to reproduce
filename := "malicious.sh";dummy=.txt"
Working code to debug
Version/commit
Reference
RFC 6266 (section 5)
https://tools.ietf.org/html/rfc6266#section-5
What WG - html spec > multipart/form-data :
https://html.spec.whatwg.org/#multipart-form-data
OWASP ASVS (Related issue):
OWASP/ASVS#1390
Golang impliments:
https://github.com/golang/go/blob/e0e0c8fe9881bbbfe689ad94ca5dddbb252e4233/src/mime/multipart/writer.go#L144
Spring (Java) Impliments:
https://github.com/spring-projects/spring-framework/blob/4f8516e2c3ca420b1608840ab901bf9df7e4d5f1/spring-web/src/main/java/org/springframework/http/ContentDisposition.java#L594-L617
Symfony(PHP) Impliments:
https://github.com/symfony/symfony/blob/123b1651c4a7e219ba59074441badfac65525efe/src/Symfony/Component/HttpFoundation/HeaderUtils.php#L187-L189
This is my own article, but it summarizes the impact, etc. on this issue.
https://gist.github.com/motoyasu-saburi/1b19ef18e96776fe90ba1b9f910fa714
The text was updated successfully, but these errors were encountered: