Skip to content

docs: document why Owner::own_result poisoning is safe#626

Merged
QuantumExplorer merged 1 commit into
developfrom
doc/owner-poisoning-not-exploitable
Mar 9, 2026
Merged

docs: document why Owner::own_result poisoning is safe#626
QuantumExplorer merged 1 commit into
developfrom
doc/owner-poisoning-not-exploitable

Conversation

@QuantumExplorer
Copy link
Copy Markdown
Member

Summary

Context

A security audit flagged that Owner::own_result leaves the Owner in a poisoned state when the closure returns Err. Investigation confirmed this is not exploitable:

  • All call sites are in Walker methods (walk, walk_expect, attach, put_value, etc.)
  • On every error path, the Walker (which owns the Owner<TreeNode>) is dropped immediately
  • The poisoned Owner is never accessed after own_result returns Err
  • The panic is unreachable in practice

Changing the signature to FnOnce(T) -> Result<T, (T, E)> was evaluated and rejected — it adds complexity to every closure for no practical benefit.

This PR adds an "audit note" section to the doc comment so future audits don't re-investigate or attempt to fix this non-issue.

Test plan

  • Existing tests pass (no code changes, only doc comment)

🤖 Generated with Claude Code

All call sites are in Walker methods where the Owner is dropped
immediately on error, making the poisoned state unreachable. Document
this analysis so future audits don't attempt to fix a non-issue.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Mar 9, 2026

Warning

Rate limit exceeded

@QuantumExplorer has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 23 minutes and 51 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 9254ab5a-4826-4c18-8829-afd3fdbc5579

📥 Commits

Reviewing files that changed from the base of the PR and between 650acf4 and 129f113.

📒 Files selected for processing (1)
  • merk/src/owner.rs
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch doc/owner-poisoning-not-exploitable

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@QuantumExplorer QuantumExplorer merged commit 61b9f83 into develop Mar 9, 2026
6 of 7 checks passed
@QuantumExplorer QuantumExplorer deleted the doc/owner-poisoning-not-exploitable branch March 9, 2026 10:46
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