Skip to content

php: dangerous eval#115

Merged
sanket-deepsource merged 1 commit intoDeepSourceCorp:masterfrom
hrideshmg:php_injection
Feb 24, 2025
Merged

php: dangerous eval#115
sanket-deepsource merged 1 commit intoDeepSourceCorp:masterfrom
hrideshmg:php_injection

Conversation

@hrideshmg
Copy link
Contributor

Description

This PR introduces a new security checker named dangerous_eval to detect unsafe usage of eval() in PHP code. The use of eval() 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:

  • Direct usage of eval() with a variable input
  • eval() with string concatenation involving user input
  • eval() with interpolated strings containing variables
  • eval() with PHP superglobal variables (variables that are populated externally) ($_GET, $_POST, $_REQUEST, etc.)

@vercel
Copy link

vercel bot commented Feb 24, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
globstar ⬜️ Ignored (Inspect) Visit Preview Feb 24, 2025 5:54pm

Copy link
Contributor

@sanket-deepsource sanket-deepsource left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! I've left some suggestions before we can go ahead with this.

@sanket-deepsource
Copy link
Contributor

@hrideshmg Please also make sure that your commits are GPG signed.

@hrideshmg
Copy link
Contributor Author

Thanks for your contribution! I've left some suggestions before we can go ahead with this.

Thanks for the suggestions, I've made the required changes!

@sanket-deepsource sanket-deepsource merged commit fcfe489 into DeepSourceCorp:master Feb 24, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants