Skip to content

Restrict cache pickle deserialization - #239

Open
3em0 wants to merge 1 commit into
AD-Security:mainfrom
3em0:fix/restrict-cache-pickle-loading
Open

Restrict cache pickle deserialization#239
3em0 wants to merge 1 commit into
AD-Security:mainfrom
3em0:fix/restrict-cache-pickle-loading

Conversation

@3em0

@3em0 3em0 commented Jun 4, 2026

Copy link
Copy Markdown

Summary

  • add a restricted cache unpickler that only allows AD Miner cache model classes and basic containers
  • route cache loading in both the main cache class and analyse_cache.py through the restricted loader
  • preserve direct execution of analyse_cache.py by adding an import fallback for local script execution

Fixes #238

Verification

  • python -m compileall ad_miner/scripts/analyse_cache.py ad_miner/sources/modules/cache_class.py ad_miner/sources/modules/cache_security.py
  • malicious pickle PoC is rejected with Unsupported cache object: builtins.eval and does not create the marker file
  • legitimate AD Miner Node/Path cache object still loads through the restricted loader

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.

Unsafe pickle deserialization when loading AD Miner cache files

1 participant