Skip to content

Zip parser: tolerate 2-byte overlap in file entries#561

Merged
val-ms merged 2 commits intoCisco-Talos:mainfrom
val-ms:CLAM-1763-overlapping-files
Jul 18, 2022
Merged

Zip parser: tolerate 2-byte overlap in file entries#561
val-ms merged 2 commits intoCisco-Talos:mainfrom
val-ms:CLAM-1763-overlapping-files

Conversation

@val-ms
Copy link
Contributor

@val-ms val-ms commented Apr 22, 2022

The heuristic to alert on overlapping file entries is detecting some
non-malicious JAR files observed in critical enterprise software.
The goal with overlap detection is to alert on non-recursive zip-
bombs, so this tiny overlap isn't a concern.
We'll allow a 2-byte overlap so we don't alert on such zips.

Ref: CLAM-1763

The heuristic to alert on overlapping file entries is detecting some
non-malicious JAR files observed in critical enterprise software.
The goal with overlap detection is to alert on non-recursive zip-
bombs, so this tiny overlap isn't a concern.
We'll allow a 2-byte overlap so we don't alert on such zips.
@val-ms val-ms added this to the 1.0 milestone Apr 29, 2022
Copy link
Contributor

@m-sola m-sola left a comment

Choose a reason for hiding this comment

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

Functionally, confirmed no more alert on provided test file.

I don't love how all of this is on one line. If it's not too much trouble could we break the logic up into something more readable?

@val-ms
Copy link
Contributor Author

val-ms commented Jul 5, 2022

Functionally, confirmed no more alert on provided test file.

I don't love how all of this is on one line. If it's not too much trouble could we break the logic up into something more readable?

Ok I think I fixed it in a nice way. Please re-review.

Copy link
Contributor

@m-sola m-sola left a comment

Choose a reason for hiding this comment

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

Updates look good!

@val-ms val-ms added the 🍒cherry-pick-candidate A PR that should be backported once approved. label Jul 15, 2022
@val-ms val-ms merged commit c86ce2e into Cisco-Talos:main Jul 18, 2022
@val-ms val-ms deleted the CLAM-1763-overlapping-files branch July 18, 2022 18:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🍒cherry-pick-candidate A PR that should be backported once approved.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants