Skip to content

docs: correct the v0.0.7 changelog and advisory claims - #13

Merged
johanbeytell1 merged 1 commit into
mainfrom
arena/390295bd-codesafe
Dec 1, 2026
Merged

johanbeytell1 merged 1 commit into
mainfrom
arena/390295bd-codesafe

Conversation

@johanbeytell1

Copy link
Copy Markdown
Member

Three claims overstated what 0.0.6 actually allowed. Every figure below was re-measured against the published 0.0.6 wheel from outside the repository, so the installed package is the one under test.

1. Rebound builtin name — not a vulnerability

Labelled a fixed security hole. It wasn't:

Expression 0.0.6 0.0.7
(len := h)() UnsafeExpressionError UnsafeExpressionError
(lambda len: len())(h) UnsafeExpressionError UnsafeExpressionError
[h() for len in [1]] UnsafeExpressionError UnsafeExpressionError

0.0.6 already blocked all three — its call check required the target to be allowlisted, whatever name it was reached through. The 0.0.7 name-resolution rule is defence in depth, and the entry now says so.

2. file_access=False "bypass" — unreachable

Case 0.0.6 File created
open via allowed_builtins UnsafeExpressionError no
+ allowed_function_calls=['open'] RuntimeError yes, inside the sandbox — but the handle cannot cross the result boundary

So there was no host-side bypass. The 0.0.7 ordering change makes the invariant structural instead of dependent on the AST check; the entry now says that.

3. Callables invoked by builtins — real, but described vaguely

sorted(key=h) and iter(h, None) did invoke the caller's function on 0.0.6 (host RAN: True in both cases), then failed afterwards — AttributeError for sorted, timeout for iter. That's a genuine gap in the call policy, so the entry keeps its Security Fix status but now states exactly what happened rather than the hand-waving "follow the same allowlist".

Why it slipped

Earlier probes ran from the repository root, where import codesafe resolves to the local 0.0.7 tree rather than the installed 0.0.6 wheel — so pre-fix behaviour appeared already-blocked. All measurements behind this PR were taken from outside the repository. Noted in the commit message so it doesn't recur.

Docs only; 114 tests unaffected.

Three claims in the README overstated what 0.0.6 actually allowed. Verified
against the published 0.0.6 wheel, running from outside the repository so the
installed package is the one under test:

1. Rebinding a safe-builtin name ("(len := f)()", "(lambda len: len())(f)",
   "[f() for len in [1]]") was labelled a fixed vulnerability. It was not:
   0.0.6 rejected all three with UnsafeExpressionError, because its call check
   required the *target* to be allowlisted regardless of the name used. The
   0.0.7 name-resolution rule is defence in depth, and the entry now says so.

2. Re-introducing open through allowed_builtins was described as bypassing
   file_access=False. It did not: 0.0.6 raised UnsafeExpressionError, and with
   allowed_function_calls=['open'] the file handle still could not cross the
   result boundary. The 0.0.7 ordering change makes the invariant structural
   rather than dependent on the AST check; the entry now says that instead.

3. Callables passed to builtins ("sorted(key=f)", "iter(f, None)") were
   described as merely "following the same allowlist". In fact 0.0.6 *did*
   invoke the caller's function - it just failed afterwards (AttributeError for
   sorted, timeout for iter). That gap is real, so the entry keeps its
   Security Fix status but now states precisely what happened.

Also drops the rebinding claim from the summary bullet list, which repeated the
same overstatement.

Worth recording why this slipped: earlier probes ran from the repository root,
so 'import codesafe' picked up the local 0.0.7 tree instead of the installed
0.0.6 wheel, making pre-fix behaviour look already-blocked. All measurements
behind this commit were taken from outside the repository.

Docs only; 114 tests unaffected.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
@johanbeytell1
johanbeytell1 merged commit 68fd581 into main Dec 1, 2026
7 checks passed
johanbeytell1 added a commit that referenced this pull request Dec 1, 2026
PR #13 got these wrong, and its own measurement method was at fault. Re-ran
every case against the installed 0.0.6 wheel from outside the repository, with a
counting host function, so 'was it called' is measured rather than inferred:

  sorted([2,1], key=f), f unallowlisted  -> 0.0.6 returned [2, 1], host_calls=0
  max([2,1], key=f)                      -> 0.0.6 returned 2,      host_calls=0
  iter(f, None)                          -> 0.0.6 timed out,       host_calls=0

So 0.0.6 never invoked these callbacks. PR #13 claimed it did; that came from a
marker file written by the *0.0.7* run, because the probe executed from the
repository root where 'import codesafe' resolves to the local tree. Same class
of mistake as the one #13 was meant to fix.

Corrected:
- Callables via builtins: 0.0.6 already refused these paths. 0.0.7's allowlist
  rule is defence in depth, not a fix. Reclassified.
- file_access: measured again and PR #13 was wrong in the other direction. With
  open in allowed_builtins AND in allowed_function_calls, 0.0.6 did create the
  file despite file_access=False. So this IS a real fix (misconfiguration-
  dependent, not a sandbox escape). Restored to Security Fix with the
  precondition stated.
- Rebinding: unchanged from #13 - 0.0.6 rejected all shapes, defence in depth.

Docs only; 114 tests unaffected.

Co-authored-by: arena-agent <297053741+arena-agent@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant