feat(analyzer): detect privileged container execution and escape primitives as PE5#214
Open
CharmingGroot wants to merge 1 commit into
Open
feat(analyzer): detect privileged container execution and escape primitives as PE5#214CharmingGroot wants to merge 1 commit into
CharmingGroot wants to merge 1 commit into
Conversation
…itives as PE5 PE4 detects Docker socket access; PE5 is its CLI counterpart for privileged container execution and escape primitives (docker run --privileged / -v /:/ / --cap-add=SYS_ADMIN, host namespaces --pid/net=host, --device, --security-opt unconfined, nsenter, cgroup release_agent, /proc/<pid>/ns/, unshare --map-root-user) that reach the same host takeover. Mirrors PE4's best-confidence-per-line pass with the documentation-example filter. Signed-off-by: CharmingGroot <ohyes9711@gmail.com>
rng1995
approved these changes
Jun 27, 2026
rng1995
left a comment
Collaborator
There was a problem hiding this comment.
Approving — strong additive PE5 (privileged container / container escape) detection: privileged flags, host-root mount, dangerous --cap-add, host namespaces, --device, unconfined, nsenter, the cgroup release_agent escape (CVE-2022-0492 class, 0.95), /proc/<pid>/ns/, and unshare. Per-line best-confidence dedup avoids double-reporting a multi-flag docker run, doc examples are filtered, and existing PE1–PE4 are untouched. Test coverage is excellent.
Non-blocking: --device[=\s]+/dev/ (0.7) will also flag legitimate hardware passthrough (e.g. /dev/nvidia0, /dev/snd); acceptable for a manual-review signal at that confidence, but worth keeping an eye on for FP noise.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PE4 (#189) detects Docker socket access. This adds PE5, its CLI counterpart: privileged container execution and container-escape primitives that reach the same host takeover through
docker runflags and kernel interfaces. Verified undetected on v2.3.5 in #213.Changes
static_patterns_privilege_escalation.pygainsPE5_PATTERNS(--privileged, host root mount-v /:,--cap-add=SYS_ADMIN, host namespaces--pid/net=host,--device,--security-opt …=unconfined,nsenter, cgrouprelease_agent,/proc/<pid>/ns/,unshare --map-root-user) and a best-confidence-per-line PE5 pass that mirrors PE4, with the documentation-example filter applied. PE5 findings are HIGH.Testing
12 new tests cover each primitive (privileged, host root mount, cap-add, host namespaces, nsenter, release_agent, unshare), multi-flag dedup (one finding per line), a benign
docker runnegative, and a markdown documentation-example exclusion.make formatandmake lintpass;uv run pytest -m "not integration and not provider"reports 999 passed, 0 failed.Closes #213