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

Deprecate CGI Servlet - CVE-2023-36479 #9887

Closed
sbordet opened this issue Jun 7, 2023 · 7 comments · Fixed by #9888 or #9889
Closed

Deprecate CGI Servlet - CVE-2023-36479 #9887

sbordet opened this issue Jun 7, 2023 · 7 comments · Fixed by #9888 or #9889
Assignees
Labels
Bug For general bugs on Jetty side

Comments

@sbordet
Copy link
Contributor

sbordet commented Jun 7, 2023

Jetty version(s)
9+

Description
Class CGI should be deprecated for removal.

@sbordet sbordet added the Bug For general bugs on Jetty side label Jun 7, 2023
@sbordet sbordet self-assigned this Jun 7, 2023
sbordet added a commit that referenced this issue Jun 7, 2023
Signed-off-by: Simone Bordet <[email protected]>
sbordet added a commit that referenced this issue Jun 7, 2023
Signed-off-by: Simone Bordet <[email protected]>
sbordet added a commit that referenced this issue Jun 8, 2023
sbordet added a commit that referenced this issue Jun 8, 2023
@fhackenberger
Copy link

@sbordet Could you please explain why it's being removed? We are using it in our production set-up to serve small generated image files. Having to set-up a separate webserver just to run the CGI scripts would break encapsulation for our app.

@joakime joakime changed the title Deprecate CGI Servlet Deprecate CGI Servlet - CVE-2023-36479 Apr 22, 2024
@joakime
Copy link
Contributor

joakime commented Apr 22, 2024

@sbordet Could you please explain why it's being removed? We are using it in our production set-up to serve small generated image files. Having to set-up a separate webserver just to run the CGI scripts would break encapsulation for our app.

See CVE-2023-36479

@fhackenberger
Copy link

Link for people wondering how to replace it (for PHP): Jetty 12 Guide: FastCGI. I don't see a direct replacement for other CGI scripts which don't have FCGI servers available though (which is our use case). @joakime do you have any hints?

@joakime
Copy link
Contributor

joakime commented Apr 22, 2024

Correct, FastCGI requires a FastCGI server.

You could copy the CGI.java into your own project and use it as-is (it is open source, just follow the license).
You will have to deal with maintaining it and try to handle the vulnerability on your own. (you might even just prune down it's functionality to something very narrowly defined for your use case)

@fhackenberger
Copy link

Sure, that always works. Would you be open for a patched CGI.java, fixing the CVE?

@sbordet
Copy link
Contributor Author

sbordet commented Apr 22, 2024

Would you be open for a patched CGI.java, fixing the CVE?

It is a big risk to call the Process APIs to invoke an external process -- an attacker would just go:

$ git clone https://github.com/jetty/jetty.project.git
$ cd jetty.project
$ git grep "java.lang.Process"

And start pounding.

As Jetty is continuously reviewed for security vulnerabilities, this would be a liability that would need serious consideration before being re-introduced.

As a matter of fact, to my knowledge, you are the first user that reported using the CGI class.
We removed it in 12 (after long deprecation in 11) with not many concerns, thinking nobody was using it. 🤷🏼‍♂️

@joakime
Copy link
Contributor

joakime commented Apr 22, 2024

Sure, that always works. Would you be open for a patched CGI.java, fixing the CVE?

We will not be reintroducing old school CGI features to Jetty.
The risks far outweigh the use and maintenance.
Most projects that used CGI in the past have moved to FastCGI now (the last project I was aware of moving did so back in 2002).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side
Projects
None yet
3 participants