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

OSS Detect Backdoor goes OOM on a package #452

Closed
maxboone opened this issue Dec 13, 2023 · 5 comments · Fixed by #453
Closed

OSS Detect Backdoor goes OOM on a package #452

maxboone opened this issue Dec 13, 2023 · 5 comments · Fixed by #453

Comments

@maxboone
Copy link

On the package https://github.com/lxyeternal/pypi_malregistry/tree/main/aioconsol the OSS Detect Backdoor goes haywire on my system and eats up all the memory in seconds. This happened on multiple (x86) machines using the latest binary release.

Possibly there is a memory leak scanning there?

@scovetta
Copy link
Member

Wow, thanks for reporting this. I was able to repro, ate up 126 GB of memory before getting killed. It's definitely a bug, getting stuck in the 22 MB long line in the setup.py file.

Not sure if this is within the regex engine or our code, but either way, we'll take a look.

@gfs
Copy link
Contributor

gfs commented Dec 21, 2023

My suspicion would be one of the patterns used is exponential. Maybe worth trying enabling non-backtracking mode for the app inspector engine in characteristic tool.

@gfs
Copy link
Contributor

gfs commented Jan 2, 2024

Starting to investigate this, I've tested with Non-backtracking regex (WIP commit: #453) and that seems to resolve the memory usage/infinite loop issue, but this sample also revealed an unrelated issue in ApplicationInspector (microsoft/ApplicationInspector#571). Will need to incorporate the new version of appinspector with that fix to be fully confident that the non-backtracking change will resolve this, and will require a little plumbing work to build the tools with newer .net and likely expose the configuration parameter for non-backtracking as well. Likely will be able to resolve this this week.

@gfs
Copy link
Contributor

gfs commented Jan 5, 2024

I believe the linked change in #453 should fix this. I scanned all 3 versions of the package mentioned above at the same time (not sure if its only an issue with a specific version) and see a max memory usage of 8GB for ~2 million matches.

@gfs gfs closed this as completed in #453 Jan 9, 2024
@gfs
Copy link
Contributor

gfs commented Jan 12, 2024

We had some pipeline issues that should now be resolved and the fix for this is now available in the latest release. If you can still replicate the issue please reach back out. Thanks.

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 a pull request may close this issue.

3 participants