Skip to main content

◈ Security / Linux Auditing · 2026

VulnSys — Linux Privilege-Boundary Auditor

A dependency-free Python auditor that separates a writable permission bit from a confirmed attacker path, then reports the evidence in five formats

Python 3.10+Python standard librarypathlibos / stat
Project overview
14 modulesChecks
0Runtime deps
Python 3.10–3.13Test matrix
5Report formats

VulnSys is a Linux local privilege-escalation risk auditor written with the Python standard library only. Fourteen modular checks cover SUID/SGID binaries, sudo policy, writable PATH entries, cron, systemd units and timers, file capabilities, POSIX ACLs, credential files, container sockets, kernel protections and data exposure. Instead of flagging a mode bit, permission-sensitive checks share one evaluator that resolves primary and supplementary group membership, walks the full parent chain, understands sticky directories and containers with remapped UIDs — group-writable is only called vulnerable when an untrusted writer can be proven. Every finding carries evidence and a confidence level, coverage gaps stay explicit, and results export as terminal report, JSON, SARIF, Markdown and a standalone HTML report.

// tech stack

Python 3.10+Python standard librarypathlibos / statpwd / grptomllibunittestRuffmypySARIFGitHub ActionsHTML / CSS

// the challenge

Local privilege-escalation scanners tend to produce noise: a SUID binary with a group-writable parent directory and a sudo rule that ends in a wildcard quoted as critical, even when no unprivileged account can actually use them. On containers with remapped UID ownership the problem is worse — host-owned files suddenly look attacker-writable, and a report full of false positives is worse than no report at all.

// the solution

All permission logic lives in one evaluator (core/permissions.py). It models an identity context — effective UID, effective GID, supplementary groups and namespace trust — then classifies a path from its mode, ownership and full parent chain, with sticky-directory and symlink handling. Group-write becomes a finding only if the group has a member outside the trust set, so "world-writable" is replaced by "reachable by this identity". Container and user-namespace detection qualifies or suppresses ownership findings and records the limitation in every output. Checks are small modules on a shared runner with per-check timeouts; rules live in data/rules.json and can be explained from the CLI.

// measurable impact

A single command gives a reviewable picture of a host: 14 checks with severity, evidence, confidence and coverage limits, exportable as JSON, SARIF for GitHub code scanning, Markdown for tickets or a self-contained HTML page. The absence of third-party dependencies means the tool can be copied onto a hardened host and run without a package manager, and the CI matrix keeps the behaviour identical across Python 3.10 to 3.13 with Ruff, mypy and a packaging smoke test.

Timeline
Jul 2026 – Aug 2026
Team
Solo
Role
Architecture, permission engine, 14 checks, reporting formats, test suite, packaging and CI

// key highlights

  • ◆Single permission evaluator shared by every permission-sensitive check — evidence instead of mode-bit guessing
  • ◆Identity-aware verdicts: group-write only confirmed with an untrusted group member, sticky-bit aware parent walk
  • ◆Container and user-namespace awareness that qualifies ownership findings instead of producing false positives
  • ◆14 modular checks on a runner with per-check timeouts, profiles and exclude lists
  • ◆Five output formats including SARIF for GitHub code scanning and a standalone HTML report
  • ◆Zero runtime dependencies; CI runs unittest on Python 3.10–3.13 plus Ruff, mypy and a wheel build

// implementation sample

def system_group_members(gid: int) -> set[int]:
    """Resolve both primary and supplementary members of a Unix group."""
    try:
        members = {account.pw_uid for account in pwd.getpwall() if account.pw_gid == gid}
    except OSError:
        members = set()
    try:
        names = grp.getgrgid(gid).gr_mem
    except KeyError:
        names = ()
    for name in names:
        try:
            members.add(pwd.getpwnam(name).pw_uid)
        except KeyError:
            continue
    return members


def assess_path(
    path: str | Path,
    *,
    identity: IdentityContext | None = None,
    follow_symlinks: bool = True,
    group_members: Callable[[int], set[int]] = system_group_members,
) -> PermissionAssessment:
    identity = identity or IdentityContext.current()
    target = Path(path)
    try:
        info = target.stat() if follow_symlinks else target.lstat()
    except FileNotFoundError:
        return PermissionAssessment(str(target), False, error="not found")