Skip to content

Conversation

@jackulau
Copy link

@jackulau jackulau commented Dec 10, 2025

Add pattern to detect libevent version in Android libraries where the version string format differs from standard Linux binaries.

  • Add FILENAME_PATTERNS to match libevent library files
  • Add VERSION_PATTERN to match Android format where version appears before "Active events:" diagnostic string
  • Add test case for Android libevent format

Summary

Addresses #5441 - Android libevent library not detected by CVE-bin-tool.

  • Added FILENAME_PATTERNS to match libevent library files
  • Added new VERSION_PATTERN to detect version in Android binaries where the version string is standalone
  • Added test case for Android libevent format

Details

The existing patterns required the string libevent using: to be adjacent to the version, which is not the case in Android binaries. In Android's libevent.so, the version string 2.1.8-stable appears standalone between other diagnostic strings.

The new pattern:

r"([0-9]+\.[0-9]+\.[0-9]+)-stable\r?\nActive events:"

Matches:

  • Confirmed pattern detects version 2.1.8

Test plan

  • Run pytest -k libevent to validate test cases

Add pattern to detect libevent version in Android libraries where the
version string format differs from standard Linux binaries.

- Add FILENAME_PATTERNS to match libevent library files
- Add VERSION_PATTERN with word boundary to match formats like
  "libevent-2.1.8-stable" while avoiding false positives
- Add test case for Android libevent format
@jackulau jackulau force-pushed the 5441_libevent branch 2 times, most recently from 6b7696a to b8a6c8b Compare December 12, 2025 03:43
Update VERSION_PATTERN to handle null byte separators in Android
libevent binaries.

- Change pattern to match null byte (\x00) separators
- Handle optional "Inserted events:" between version and "Active events:"
- Add test cases for Android libevent formats

Tested on Android API 28, 29, 30, 34

Partial fix for ossf#5441

Signed-off-by: Jack <[email protected]>
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.

1 participant