Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ An open-source Python library for code encryption, decryption, and safe evaluati
| :--- | :--- | :--- | :--- |
| `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 |
| `safe_eval` sandbox escape via dunder attribute access with `allow_attributes=True` (string-argument indirection, e.g. `().__getattribute__('__class__')`) | [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** |
| Remote code execution in the calling process via unsafe deserialization of the `safe_eval()` result (cloudpickle) | GHSA to be assigned · CVE pending | 0.0.6 | **0.0.7** |
| Remote code execution in the calling process via unsafe deserialization of the `safe_eval()` result (cloudpickle) | [GHSA-2565-87hp-2588](https://github.com/Infinitode/CodeSafe/security/advisories/GHSA-2565-87hp-2588) · CVE pending | 0.0.6 | **0.0.7** |

You can browse all advisories at https://github.com/Infinitode/CodeSafe/security/advisories

Expand All @@ -40,6 +40,8 @@ You can browse all advisories at https://github.com/Infinitode/CodeSafe/security

**What `safe_eval()` returns in 0.0.7.** Results are restricted to plain data: `None`, `bool`, `int`, `float`, `complex`, `str`, `bytes`, `decimal.Decimal`, `fractions.Fraction`. Containers of plain data (`list`, `tuple`, `dict`, `set`) are returned only when `allow_objects=True` is passed. Lambdas, classes, instances of user-defined types, modules and generators are no longer returned - they raise a clear `RuntimeError` instead of being serialized. If your code relied on returning lambdas or dynamic classes, restructure the expression to return data.

**Advisory**: [GHSA-2565-87hp-2588](https://github.com/Infinitode/CodeSafe/security/advisories/GHSA-2565-87hp-2588). Reported by **Juan Lucas Armendares** of **Sunplace Solutions** - thank you for finding and reporting this.

### Second sandbox-escape issue fixed in v0.0.6

**Versions 0.0.3 through 0.0.5, when `safe_eval()` is called with `allow_attributes=True` (not the default), allowed dunder attributes to be read indirectly through string arguments that the AST validator never inspects.**
Expand Down Expand Up @@ -128,6 +130,7 @@ python -m unittest test.py test_poc_vulnerability.py -v
* **Changed**: The result transport is a `multiprocessing.Pipe` drained by a reader thread instead of a `Queue`. A result larger than the OS pipe buffer can no longer deadlock the parent, and the timing of `EvaluationTimeoutError` is tighter.
* **Changed**: The `cloudpickle` dependency was removed - CodeSafe no longer imports pickle on the evaluation path at all.
* Added regression tests for every item above (see [Vulnerability & Security Testing](#vulnerability--security-testing-test_poc_vulnerabilitypy)).
* **Credit**: The critical result-deserialization issue above was reported by **Juan Lucas Armendares** of **Sunplace Solutions** - many thanks. See [GHSA-2565-87hp-2588](https://github.com/Infinitode/CodeSafe/security/advisories/GHSA-2565-87hp-2588).

### Changelog v0.0.6:

Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Only the latest release receives fixes. Please upgrade rather than report issues
| :--- | :--- | :--- | :--- |
| `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 |
| `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 |
| 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 |
| Remote code execution in the calling process via unsafe deserialization of the `safe_eval()` result | [GHSA-2565-87hp-2588](https://github.com/Infinitode/CodeSafe/security/advisories/GHSA-2565-87hp-2588) · CVE pending | 0.0.6 | 0.0.7 |

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

Expand Down
Loading