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] Added edge cases for tainted pickle deserialization #3355

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

theinfosecguy
Copy link
Contributor

  • Added pattern-not conditions to exclude safe usage patterns and minimize false positives.
  • Added new test cases to cover a wider range of scenarios, including both vulnerable and safe usage patterns.

The patterns like pickle.load(pickle.dumps(...)) are added to pattern-not to avoid false positives in situations where the data being deserialized is explicitly serialized using pickle.dumps() within the same codebase.

@0xDC0DE 0xDC0DE enabled auto-merge (squash) October 15, 2024 08:06
@0xDC0DE
Copy link
Contributor

0xDC0DE commented Oct 15, 2024

Looks like a good update to me! Thanks for your contribution!

Comment on lines +45 to +52
# ruleid: tainted-pickle-deserialization
pickle.load(pickle.dumps(event['exploit_code']))

# ruleid: tainted-pickle-deserialization
_pickle.loads(_pickle.dumps(event['exploit_code']))

# ruleid: tainted-pickle-deserialization
cPickle.load(cPickle.dumps(event['exploit_code']))
Copy link
Contributor

Choose a reason for hiding this comment

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

Looks like these are incorrectly annotated. If I understand correctly, you don't want these to match. This should be fixed before we can merge these changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants