---
title: "CodeVerifier admits shell commands reached…"
description: "GHSA-qrp4-p44j-m484: CodeVerifier admits shell commands reached through the module loader… Affected and fixed versions of qwed."
url: https://qwedai.tech/security/advisories/ghsa-qrp4-p44j-m484
---

[Security](https://qwedai.tech/security) · [Advisories](https://qwedai.tech/security/advisories) · GHSA-qrp4-p44j-m484

# CodeVerifier admits shell commands reached through the module loader (\_\_loader\_\_.load\_module('posix').system)

high Fixed in 9.0.0 GHSA-qrp4-p44j-m484 · Published 6 November 2026

## Impact

`CodeVerifier.verify_code` returns `VERIFIED`, `is_valid: true` and admission `ADMIT` for Python that runs a shell command through the module loader object every module has. `POST /verify/code` returns the same verdict.

| `code` | `main` @ `b74ac00` | Correct |
| --- | --- | --- |
| `__loader__.load_module('posix').system('id')` | `VERIFIED`, `is_valid: true`, `ADMIT` | unsafe (runs `id`) |
| `__spec__.loader.load_module('posix').system('id')` | `VERIFIED`, `is_valid: true`, `ADMIT` | unsafe |
| `import os; os.system('id')` (control) | `VERIFIED`, `is_valid: false`, `BLOCKED` | correct |

`__loader__` is the module's `BuiltinImporter`/`SourceFileLoader`. `load_module('posix')` returns the `posix` module, so the call is `os.system` without an `import` statement or a name the denylist knows.

The false verdict is in the result: `CodeGuard` and the sandbox's own pattern check do block `.system`, so QWED does not run this code itself. A caller that gates execution on `/verify/code`'s admission would.

## Affected

`qwed` (PyPI) through 8.0.0. Reproduced on `main` @ `b74ac00`.

Reachable from:

-   `POST /verify/code`;
-   the `CodeVerifier.verify_code` Python API.

## Reproduction

```python
from qwed_new.core.code_verifier import CodeVerifier
from qwed_new.core.diagnostics import admission_decision

cv = CodeVerifier()
for code in ["__loader__.load_module('posix').system('id')",
             "__spec__.loader.load_module('posix').system('id')",
             "import os\nos.system('id')"]:
    dr = cv.verify_code(code, language="python")
    print(repr(code), dr.status.value, dr.developer_fields.get("is_valid"), admission_decision(dr).value)
```

## Details

-   `src/qwed_new/core/code_verifier.py:313`: `PYTHON_DANGEROUS_ATTRS` does not list `__loader__`, `__spec__`, `loader` or `load_module`.
-   The checks that catch `os.system` look for a module the snippet imported or a known dangerous name. `__loader__` is neither: it is a module global that needs no import, and `load_module` takes the module name as a string.
-   The same class as GHSA-4phf-6h72-9xfg and GHSA-jrxf-9jh4-86w7 (a dangerous capability reached through an object the denylist does not model).

## Patches

Fixed in 9.0.0 ([`4cd0574`](https://github.com/QWED-AI/qwed-verification/commit/4cd05742754886e0d379983efbec2e957a7b9de5) ). Upgrade to 9.0.0 or later.

-   `__loader__` and `__spec__` are dangerous attributes.
-   The loader methods and import-system internals that return a module by name (`load_module`, `create_module`, `module_from_spec` and the importlib bootstrap functions and modules) are refused wherever they appear: called or not, as an attribute, an import or alias, or a string.
-   `pkgutil.resolve_name` and `pydoc.locate` are refused, with import aliases resolved.
-   Any read of `sys.modules` is refused, not only a subscript (`sys.modules.get(...)`, `from sys import modules`).

On 9.0.0 both rows of the table above are `VERIFIED`, `is_valid: false`, `BLOCKED` (`dangerous_attribute`, `dangerous_function`).

[All advisories](https://qwedai.tech/security/advisories)

Affected and fixed

qwed

Affected <= 8.0.0 Fixed in 9.0.0

Weakness

CWE-184 Incomplete List of Disallowed Inputs CWE-693 Protection Mechanism Failure

[View on GitHub](https://github.com/QWED-AI/qwed-verification/security/advisories/GHSA-qrp4-p44j-m484)
