QWED

Type to search pages, engines and advisories.

    Looking for API details?Search the docs

    Security·Advisories·GHSA-7xrf-75qr-2r5w

    /verify/code admits JavaScript and Java that run commands, SQL that drops tables, and Python that uses names it never imports

    highFixed in 11.0.0GHSA-7xrf-75qr-2r5w · Published 20 November 2026

    Impact

    POST /verify/code returns VERIFIED, is_valid: true and admission ADMIT for code that runs commands or destroys data, in three ways:

    language code main @ d4ca8dc
    javascript const {exec} = require('child_process'); exec('id'); VERIFIED, is_valid: true, ADMIT
    java Runtime r = Runtime.getRuntime(); r.exec("id"); VERIFIED, is_valid: true, ADMIT
    sql DROP TABLE users VERIFIED, is_valid: true, ADMIT
    sql SELECT 1; DROP TABLE users VERIFIED, is_valid: true, ADMIT
    python secret = os.environ.get('AWS_SECRET_ACCESS_KEY') (no import) VERIFIED, is_valid: true, ADMIT
    python the same with import os (control) VERIFIED, is_valid: false, BLOCKED

    /verify/sql blocks both SQL statements above; the language: "sql" path of /verify/code does not use it.

    Affected

    qwed (PyPI) through 10.0.0. Reproduced on main @ d4ca8dc.

    Reachable from:

    • POST /verify/code (and batch code items) with language javascript, typescript, java, go or sql, and with python for names the snippet does not bind;
    • CodeVerifier.verify_code, which the executor and the stats gates also call.

    Reproduction

    from qwed_new.core.code_verifier import CodeVerifier
    from qwed_new.core.diagnostics import admission_decision
    
    cases = [("javascript", "const {exec} = require('child_process'); exec('id');"),
             ("java", 'Runtime r = Runtime.getRuntime(); r.exec("id");'),
             ("sql", "DROP TABLE users"),
             ("python", "secret = os.environ.get('AWS_SECRET_ACCESS_KEY')"),
             ("python", "import os\nsecret = os.environ.get('AWS_SECRET_ACCESS_KEY')")]
    for lang, code in cases:
        dr = CodeVerifier().verify_code(code, language=lang)
        print(lang, dr.status.value, dr.developer_fields.get("is_valid"), admission_decision(dr).value)
    

    Details

    • Other languages are judged by substring lists. For JavaScript, TypeScript, Java and Go, CodeVerifier searches for listed substrings (JS_CRITICAL and its siblings, src/qwed_new/core/code_verifier.py:405-509) and admits when no CRITICAL entry matches (:657). A call reached through destructuring, a variable or an alias matches nothing.
    • SQL on /verify/code has its own rules. The language: "sql" path parses with postgres hard-coded (src/qwed_new/core/code_verifier.py:1893) and applies its own checks (:1908-1953), not SQLVerifier's.
    • Python checks only names the snippet binds. The allowlist resolves a name through the snippet's own imports (_chain_targets, src/qwed_new/core/code_admission.py:969-978); a name with no binding is not checked. That matters wherever names are pre-bound: the sandbox binds np and pd, and the stats harness binds pd and df.

    Patches

    Fixed in 11.0.0. Upgrade with pip install -U "qwed>=11.0.0". /verify/code admits only code it can show safe. JavaScript, TypeScript, Java and Go are UNVERIFIABLE (code_verifier.language_unverifiable) when no listed pattern shows them unsafe, never ADMIT. SQL on /verify/code is also decided by SQLVerifier, so a write is refused. Python that reads a name it does not bind is refused; a runtime that binds names passes them with CodeVerifier(bound_names=...).

    Advisory page: https://qwedai.tech/security/advisories/ghsa-7xrf-75qr-2r5w

    All advisories

    Affected and fixed

    qwed

    Affected<= 10.0.0 Fixed in11.0.0
    Weakness
    CWE-184 Incomplete List of Disallowed InputsCWE-693 Protection Mechanism Failure
    View on GitHub