Better Spring4Shell detection logic#650
Merged
copybara-service[bot] merged 12 commits intogoogle:masterfrom Aug 4, 2025
Merged
Better Spring4Shell detection logic#650copybara-service[bot] merged 12 commits intogoogle:masterfrom
copybara-service[bot] merged 12 commits intogoogle:masterfrom
Conversation
Collaborator
|
@savio-doyensec could you rebase the branch again (there's still conflict), or could you add @tooryx and me to your org so that we have edit access to your branch? |
Contributor
Author
|
Hey @maoning, it should be fixed now. I'll check with the team on Monday about adding you guys to the repo, but I think it's a good idea. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hello!
This PR implements better detection logic for the Spring4Shell (CVE-2022-22965) vulnerability.
Also added a testbed here: google/security-testbeds#121
(Original PR here closed due to conflicts)
Details
Previously, the detector checked the response of two HTTP requests to determine whether a target was vulnerable, but this lead to false positives.
The new implementation still uses the old logic as a preliminary check to find potentially vulnerable pages, on which the full exploit is then attempted. The exploit consists of changing the log configuration in order to drop a
.jspfile in Tomcat'sROOTwebapp directory.The dropped
.jsphas a randomized name and simply prints out a string generated using Tsunami'sPayloadGenerator. There is also some extra code which make the script self-delete when visited with thedelete=1URL parameter.After dropping the
.jspfile, the log configuration is also set to point to/dev/null, in order to prevent more files to be accidentally created and left on the server.