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

Check for irregular contents in .pc files #7

Open
hlein opened this issue Apr 18, 2024 · 0 comments
Open

Check for irregular contents in .pc files #7

hlein opened this issue Apr 18, 2024 · 0 comments

Comments

@hlein
Copy link
Owner

hlein commented Apr 18, 2024

See https://marc.info/?l=oss-security&m=171335763115933&w=4

The (made up for illustrative purposes) malicious .pc file therein has a number of tells, none of which are common in a quick sample of 1,180 files I checked by hand:

  • no single-letter variable definitions
  • no alphanumeric/base64 string longer than 28 letters
  • no grep, no sed, no echo, no base64
  • no single-quoted strings
  • no variable names w/o curly braces (no $foo)
  • one single instance of $( )
  • three instances that matched "[^"]*[^- "/{}:.A-Za-z0-9]+[^"]*", easily assessed by eye.

Can we come up with some more, do they have similarly low false-positive rates, do they get any actual interesting hits on all .pc files distributed by the distros being analyzed? (We'd likely have to look at / extract .pc files from binary packages.). Is it worth formalizing this into something repeatable? Or is it going too deep down a single rabbithole?

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

No branches or pull requests

1 participant