php: dangerous eval#115
Merged
sanket-deepsource merged 1 commit intoDeepSourceCorp:masterfrom Feb 24, 2025
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Skipped Deployment
|
sanket-deepsource
requested changes
Feb 24, 2025
Contributor
sanket-deepsource
left a comment
There was a problem hiding this comment.
Thanks for your contribution! I've left some suggestions before we can go ahead with this.
Contributor
|
@hrideshmg Please also make sure that your commits are GPG signed. |
e98102f to
b5aa339
Compare
b5aa339 to
289f38d
Compare
Contributor
Author
Thanks for the suggestions, I've made the required changes! |
sanket-deepsource
approved these changes
Feb 24, 2025
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.
Description
This PR introduces a new security checker named
dangerous_evalto detect unsafe usage ofeval()in PHP code. The use ofeval()can lead to severe security vulnerabilities, including remote code execution (RCE), especially when combined with user-controlled input.Detection Logic
The checker flags the following unsafe patterns:
eval()with a variable inputeval()with string concatenation involving user inputeval()with interpolated strings containing variableseval()with PHP superglobal variables (variables that are populated externally) ($_GET,$_POST,$_REQUEST, etc.)