Skip to content

docs: correct the file_access and callable-allowlist claims (take 2) - #14

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

PR #13 got these wrong, and its measurement method was the reason. 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:

Expression (host f NOT allowlisted) 0.0.6 result host_calls
sorted([2,1], key=f) returned [2, 1] 0
max([2,1], key=f) returned 2 0
list(iter(f, None)) EvaluationTimeoutError 0

So 0.0.6 never invoked these callbacks. #13 claimed it did — that "host RAN: True" came from a marker 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 #13 was supposed to fix.

Corrections

Callables via builtins → defence in depth. 0.0.6 already refused these paths. 0.0.7's allowlist rule makes the policy explicit; it closes no hole. Reclassified.

file_access=False → Security Fix restored. #13 was wrong in the other direction. Measured again:

Case 0.0.6 File created
open via allowed_builtins only UnsafeExpressionError no
+ allowed_function_calls=['open'] RuntimeError yes

So the flag genuinely was not honoured when the host granted both. Misconfiguration-dependent rather than a sandbox escape, but real — restored to Security Fix with that precondition stated.

Rebinding → unchanged from #13: 0.0.6 rejected all shapes, defence in depth.

Docs only; 114 tests unaffected.

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>
@johanbeytell1
johanbeytell1 merged commit 40e7a51 into main Dec 1, 2026
7 checks passed
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