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

Fix unbounded ellipsis match in tar-insecure-flags rule #49

Merged
merged 5 commits into from
Feb 8, 2024
Merged

Fix unbounded ellipsis match in tar-insecure-flags rule #49

merged 5 commits into from
Feb 8, 2024

Conversation

muschempax
Copy link
Contributor

We have run across false positive matches on the tar-insecure-flags rule in some edge cases. Semgrep Support recommended this as a fix.

There are edge cases wherein the unbounded ellipsis in the rule set will unintentionally wrap across multiple lines and match on a flag in a completely different command. This test case illustrates one such condition.
This prevents multiline span matching across different commands in some edge cases.
@CLAassistant
Copy link

CLAassistant commented Jan 24, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Member

@mschwager mschwager left a comment

Choose a reason for hiding this comment

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

Sorry for the delay. This change LGTM - I think generic_ellipsis_max_span strikes a good balance between potential false positives and false negatives.

generic/tar-insecure-flags.sh Show resolved Hide resolved
@mschwager
Copy link
Member

Working on a fix for CI here: #52

@mschwager
Copy link
Member

Thanks for the fix!

@mschwager mschwager merged commit 114a6b0 into trailofbits:main Feb 8, 2024
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.

3 participants