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

Add rule to check for insecure load via joblib #3427

Closed
wants to merge 3 commits into from

Conversation

theinfosecguy
Copy link
Contributor

Added rule to find the unsafe usage of joblib.load when loading untrusted data. Loading untrusted data with joblib.load can lead to arbitrary code execution through deserialization vulnerabilities.

Also added pattern-sanitizers to avoid false positives due to safe_mode=True.

Copy link
Member

@inkz inkz left a comment

Choose a reason for hiding this comment

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

Can you please update the rule and remove taint mode from it. Do smth like this:

patterns:
- pattern: joblib.load($X,...)
- pattern-not: joblib.load($X, safe_mode=True, ...)
- focus-metavariable: $X

In your rule you are using "$UNTRUSTED_DATA" as a source of taint, which means literally everything and is going to be very inefficient, I believe this is why the PR is failing in CI.
For such cases, where you do not know what the source is exactly, we have a good old "search" mode rules 👍

@0xDC0DE 0xDC0DE closed this Oct 15, 2024
@0xDC0DE
Copy link
Contributor

0xDC0DE commented Oct 15, 2024

Closing this PR as it is stale

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