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

Running Invoke-ScubaCached on the same JSON file causes System out of memory error #1543

Open
buidav opened this issue Jan 31, 2025 · 0 comments
Labels
bug This issue or pull request addresses broken functionality

Comments

@buidav
Copy link
Collaborator

buidav commented Jan 31, 2025

🐛 Summary

@ehaines1 and then @tkol2022 noticed an issue with Invoke-ScubaCached where running the function on the same JSON file will eventually cause a System out of memory error as the file gets bigger and bigger.

A quick diff between subsequent JSON runs shows the under the protection_alerts key in the JSON (This is the output of Get-ProtectionAlert in the Defender provider code) gibberish text that gets longer and longer on each run. Seems exponential.

Image

To reproduce

Run Invoke-ScubaCached with -ExportProvider $false on the same ScubaResults JSON.

This issues DOES NOT appear when running Invoke-ScubaCached -KeepProviderExport is used.
However, when trying to convert ProviderSettingsExport.json to ScubaResults.json this issue DOES appear.

The issue seems to revolve around the conversion of ProviderSettingsExport.json to ScubaResults.json.
Only thing I can think of is that ProviderSettingsExport.json is UTF-8 NoBOM by default and ScubaResults.json is still UTF-8 BOM

Expected behavior

For there to be no memory leaks caused by encoding errors.

@buidav buidav added the bug This issue or pull request addresses broken functionality label Jan 31, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue or pull request addresses broken functionality
Projects
None yet
Development

No branches or pull requests

1 participant