Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Escape quotes in filename in ContentDisposition.Builder when charset not specified #24220

Closed
rstoyanchev opened this issue Dec 17, 2019 · 6 comments
Assignees
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@rstoyanchev
Copy link
Contributor

rstoyanchev commented Dec 17, 2019

The filename, when specified without a charset, is quoted but not checked for the presence of any unquoted " characters. We should check for those and turn into a quoted-pair.

@rstoyanchev rstoyanchev added in: web Issues in web modules (web, webmvc, webflux, websocket) type: enhancement A general enhancement labels Dec 17, 2019
@rstoyanchev rstoyanchev added this to the 5.2.3 milestone Dec 17, 2019
@rstoyanchev rstoyanchev self-assigned this Dec 17, 2019
@rstoyanchev rstoyanchev added type: bug A general bug and removed type: enhancement A general enhancement labels Dec 18, 2019
@rstoyanchev rstoyanchev changed the title Quote filename in ContentDisposition.Builder when charset not specified Escape quotes in filename in ContentDisposition.Builder when charset not specified Dec 18, 2019
@rstoyanchev rstoyanchev added the for: backport-to-5.1.x Marks an issue as a candidate for backport to 5.1.x label Dec 18, 2019
@spring-projects-issues spring-projects-issues added status: backported An issue that has been backported to maintenance branches and removed for: backport-to-5.1.x Marks an issue as a candidate for backport to 5.1.x labels Dec 18, 2019
rstoyanchev added a commit that referenced this issue Dec 26, 2019
@eranation
Copy link

Spring boot 2.0.x branch has no mitigation. (2.0.9.RELEASE is the latest and uses Spring 5.0.13, needs to be upgraded to 5.0.16, no?)

@snicoll
Copy link
Member

snicoll commented Feb 15, 2020

@eranation Spring Boot 2.0.x is EOL. If you are still using it, please upgrade as soon as possible to a supported version. In the meantime, you can set spring.version to 5.0.16.RELEASE to use a more recent maintenance release of that line.

@spring-projects spring-projects deleted a comment from rshanlever Feb 18, 2020
@spring-projects spring-projects deleted a comment from rshanlever Feb 18, 2020
@rstoyanchev
Copy link
Contributor Author

rstoyanchev commented Feb 18, 2020

@rshanlever, please use the preferred channel for follow-up questions.

@RockyMM
Copy link

RockyMM commented Jul 22, 2020

To all affected in 4.3.x, this was solved by #24580 in 4.3.27. Security researchers (not Pivotal), please update the CVE report. 🙏

@rstoyanchev
Copy link
Contributor Author

rstoyanchev commented Jul 23, 2020

@RockyMM it's worth pointing out that versions prior to 5.0 were never affected by CVE-2020-5398 and that is why they are not listed in the CVE report.

The affected ContentDisposition type which can be used for the "inline" and "attachment" types that a server can use to suggest a file name to a client did not exist prior to version 5.0. There were however methods for "Content-Disposition" in HttpHeaders but those are for "form-data" which is used to post data from a client to a server and hence a very different scenario. The change in #24580 was merely a minor improvement aimed at making the code consistent.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: web Issues in web modules (web, webmvc, webflux, websocket) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

6 participants
@rstoyanchev @snicoll @eranation @RockyMM @spring-projects-issues and others