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

Security Fix: Argument of a function used in an include/require, could lead to File Inclusion #491

Closed
wants to merge 1 commit into from

Conversation

vyskoczilova
Copy link

Argument of a function used in an include/require, could lead to File Inclusion audit.php.lang.security.file.inclusion-arg

Error from semgrep
audit.php.lang.security.file.inclusion-arg

… File Inclusion

Error from semgrep
audit.php.lang.security.file.inclusion-arg
Copy link
Member

@derrabus derrabus left a comment

Choose a reason for hiding this comment

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

Sorry, but I don't understand this change. What problem does it fix?

@nicolas-grekas
Copy link
Member

nicolas-grekas commented Aug 29, 2024

I'm like @derrabus. I has several guesses and concerns about this PR, let me share them with you in case this helps in any way:

I feel like this is something spotted by an automated security scanner. Here, the tool is missing that the method is private and is never called with arbitrary data. A quick look will indeed show you that we pass it only static data. The report is thus invalid.

About the patch, supposing there would be a security issue, it doesn't fix anything since it reuses the argument without doing any filtering nor validation of it. If the tool doesn't spot this as a security anymore, then you'd better trash that tool.

Then, such tools are just stupid automata. Please perform the analyses I just did before submitting issues in the future, that'll save time for everybody.

And last but not least, you should know that sharing possible security issues publicly is a very much discouraged practice. Pretty much all serious open-source projects have a security policy in place that you can read to know how to report security issues.

With all that said, I hope you understand why I'm closing.

@vyskoczilova
Copy link
Author

@nicolas-grekas, you're right. I appreciate your approach and explanation. I will remember and keep it in my mind for the future; I have learned quite a lot from it. I'm really sorry for the inconvenience.

Unfortunately, this is not my tool; I was part of a quality check for WooCoommerce official plugins that takes the analysis from Semver as linked: https://qit.woo.com/docs/managed-tests/security/. I will report it as a false positive.

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.

3 participants