Skip to content

Commit 2e2d65f

Browse files
Merge pull request #6 from Infinitode/arena/390295bd-codesafe
v0.0.7: fix critical RCE via unsafe result deserialization, plus sandbox hardening
2 parents d2ff49d + 62d27f8 commit 2e2d65f

7 files changed

Lines changed: 1318 additions & 122 deletions

File tree

‎.github/workflows/test.yml‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,12 @@ jobs:
4040
# dependencies are required.
4141
run: |
4242
python -m pip install --upgrade pip
43-
python -m pip install "cryptography>=41" "cloudpickle>=2.2"
43+
python -m pip install "cryptography>=41"
4444
4545
- name: Run test suite
46-
run: python -m unittest test.py test_poc_vulnerability.py -v
46+
# Plain `python -m unittest` in every shell: the previous version piped
47+
# through tee with POSIX syntax, which the Windows runners execute with
48+
# PowerShell, so the Windows job failed on the shell rather than on a
49+
# test. Runners print full output on failure, so no log scraping is
50+
# needed here.
51+
run: python run_ci_tests.py

‎README.md‎

Lines changed: 62 additions & 11 deletions
Large diffs are not rendered by default.

‎SECURITY.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,9 @@ We ask that you give us reasonable time to release a fix before any public discl
3232

3333
| Version | Supported |
3434
| :--- | :--- |
35-
| 0.0.6 and later | ✅ Yes |
36-
| 0.0.5 | ⚠️ Known issue — see [GHSA-m85r-gp57-6p5q](https://github.com/Infinitode/CodeSafe/security/advisories/GHSA-m85r-gp57-6p5q); upgrade to 0.0.6 |
35+
| 0.0.7 and later | ✅ Yes |
36+
| 0.0.6 | ⚠️ Known critical issue — the `safe_eval()` result is deserialized in the caller (remote code execution); fixed in 0.0.7 |
37+
| 0.0.5 | ⚠️ Known issue — see [GHSA-m85r-gp57-6p5q](https://github.com/Infinitode/CodeSafe/security/advisories/GHSA-m85r-gp57-6p5q); upgrade to 0.0.7 |
3738
| 0.0.1 – 0.0.4 | ❌ No — critical sandbox escape, [CVE-2026-133467](https://github.com/Infinitode/CodeSafe/security/advisories/GHSA-7gp8-3j6q-v4h8) |
3839

3940
Only the latest release receives fixes. Please upgrade rather than report issues that may already be fixed.
@@ -44,14 +45,15 @@ Only the latest release receives fixes. Please upgrade rather than report issues
4445
| :--- | :--- | :--- | :--- |
4546
| `safe_eval` sandbox escape via indirect subscript call | CVE-2026-133467 · [GHSA-7gp8-3j6q-v4h8](https://github.com/Infinitode/CodeSafe/security/advisories/GHSA-7gp8-3j6q-v4h8) | 0.0.1 - 0.0.4 | 0.0.5 |
4647
| `safe_eval` sandbox escape via dunder attribute string-argument (`allow_attributes=True`) | [GHSA-m85r-gp57-6p5q](https://github.com/Infinitode/CodeSafe/security/advisories/GHSA-m85r-gp57-6p5q) · CVE pending | 0.0.3 - 0.0.5 | 0.0.6 |
48+
| Remote code execution in the calling process via unsafe deserialization of the `safe_eval()` result | GHSA to be assigned · CVE pending | 0.0.6 | 0.0.7 |
4749

4850
See https://github.com/Infinitode/CodeSafe/security/advisories for the canonical list.
4951

5052
## Scope notes
5153

5254
CodeSafe contains two very different components, and reports are welcome for both, but keep in mind:
5355

54-
- **`safe_eval()`** is a best-effort sandbox, not a hard security boundary. Reports demonstrating escapes under documented usage are very much in scope. Reports that require you to defeat host-level isolation (containers, seccomp, etc.) are out of scope.
56+
- **`safe_eval()`** is a best-effort sandbox, not a hard security boundary. Reports demonstrating escapes under documented usage are very much in scope. Reports that require you to defeat host-level isolation (containers, seccomp, etc.) are out of scope. Since 0.0.7 the evaluation result is data-only and never deserialized with pickle, so "the result object's `__reduce__` runs in the caller" is no longer reachable; being unable to return lambdas/classes is a documented limitation, not a vulnerability.
5557
- **Encryption** protects code at rest. The built-in default key is public by design; only payloads encrypted with a user-supplied key can be confidential (see [Security Limitations & Notes](README.md#security-limitations--notes)). Reports of integrity/confidentiality failures in the v2 format (wrong key accepted, tampered payload decrypting successfully) are in scope; "the default key is public" is by design, not a vulnerability.
5658

5759
Thank you for helping make CodeSafe safer!

0 commit comments

Comments
 (0)