QWED

Type to search pages, engines and advisories.

    Looking for API details?Search the docs

    Security·Advisories·GHSA-hg73-j3qv-w4vh

    GitHub Action scan-code reports verified=true for eval, os.system, subprocess and exec reached through from-imports, importlib and getattr

    mediumFixed in 9.0.0GHSA-hg73-j3qv-w4vh · Published 6 November 2026

    Impact

    The GitHub Action's scan-code mode reports verified=true, verdict=VERIFIED, admission=ADMIT, zero findings and a passing badge for a Python file that calls eval, os.system, subprocess and exec. The only requirements are that the file imports them with from … import, imports them dynamically, or reaches them through getattr. The job exits 0.

    File scanned:

    from builtins import eval as e
    from os import system
    import importlib
    
    e("1+1")
    system("id")
    importlib.import_module("subprocess").check_output(["id"])
    getattr(__builtins__, "exec")("print(1)")
    
    Output main @ b74ac00 Correct
    verified true false
    findings_count 0 4 or more
    verdict / admission VERIFIED / ADMIT not admitted
    exit code 0 non-zero (fail_on_findings defaults to true)

    A repository that uses this mode as a required check can merge code with all four calls and show a "QWED-verified" badge for it.

    Affected

    The QWED-AI/qwed-verification GitHub Action, scan-code mode, through 8.0.0. Reproduced on main @ b74ac00 with INPUT_ACTION=scan-code, INPUT_PATHS=<file>.

    The server's /verify/code and CodeVerifier are not affected for these forms: they flag the from builtins import eval and getattr(__builtins__, …) routes.

    Reproduction

    INPUT_ACTION=scan-code INPUT_PATHS=evasions.py GITHUB_OUTPUT=out.txt python action_entrypoint.py; echo "exit=$?"
    grep -A1 -E '^(verified|findings_count|verdict|admission)<<' out.txt
    

    Details

    action_scan_code (action_entrypoint.py:302-366) has its own denylist instead of calling CodeVerifier:

    • dangerous_calls = ["eval", "exec", "compile", "__import__", "subprocess", "os.system"]. A call is matched only by its bare name (ast.Name), or by <name>.<attr> where <name> is the literal text before the dot. e(...) (an alias of eval) and system(...) (imported by name) are not matched.
    • Only ast.Import is checked against dangerous_imports. ast.ImportFrom (from os import system, from builtins import eval) is never inspected.
    • importlib is not in either list. importlib.import_module("subprocess").check_output(...) matches neither: the attribute is check_output, and the receiver is a call, not a name.
    • getattr(__builtins__, "exec")(...): the outer call's func is a Call, which neither branch handles.

    Patches

    Fixed in 9.0.0 (649f7a6). Upgrade to 9.0.0 or later. In a workflow: uses: QWED-AI/qwed-verification@v9.0.0

    • Each scanned file also goes through CodeVerifier.verify_code, and its code- and process-execution findings (dangerous_function, dangerous_attribute, process_execution, remote_code_execution) are added to the scan. A file CodeVerifier cannot verify denies the scan.
    • The local import check reads from x import y as well as import x.
    • getattr, setattr and delattr with a constant name are checked as that attribute, with import aliases resolved. A computed name cannot be checked: it is reported as a DYNAMIC_ATTRIBUTE warning (new warnings_count output) that does not fail the scan.
    • A Python file whose coding declaration is not UTF-8, or that is not valid UTF-8, denies the scan (the same gap in CodeVerifier is GHSA-pr6c-cqg8-6w5r).
    • The scope of scan-code is unchanged: file and network access are not findings. A pass means no known dangerous pattern was found, not that the code is safe.

    On 9.0.0 the file above gives verified=false, 5 findings (lines 1, 2, 6, 7 and 8), UNVERIFIABLE / DENY and exit code 1.

    All advisories