Skip to content

Improve detection of base64 execution via codecs and importlib dynamic imports#645

Merged
sobregosodd merged 2 commits intoDataDog:mainfrom
dwBruijn:exec-base64-improvement
Jan 13, 2026
Merged

Improve detection of base64 execution via codecs and importlib dynamic imports#645
sobregosodd merged 2 commits intoDataDog:mainfrom
dwBruijn:exec-base64-improvement

Conversation

@dwBruijn
Copy link
Copy Markdown
Contributor

@dwBruijn dwBruijn commented Jan 6, 2026

Hello,

Added patterns to exec-base64 rule to detect base64 decoding using codecs.decode(), importlib.import_module("base64").b64decode(...) and importlib.import_module("codecs").decode(...) (fairly common when trying to avoid detection).

These patterns were not being detected:

codecs.decode(..., 'base64')
importlib.import_module('base64').b64decode(...)
importlib.import_module('codecs').decode(..., 'base64')

@sobregosodd sobregosodd merged commit 77cb67d into DataDog:main Jan 13, 2026
10 checks passed
@sobregosodd
Copy link
Copy Markdown
Contributor

Thanks for contributing @dwBruijn !

christophetd pushed a commit that referenced this pull request Apr 10, 2026
Improve detection of base64 execution via codecs and importlib dynamic imports
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.

2 participants