Skip to content

security: harden filesystem, routing, and request resource boundaries - #719

Closed
devin-ai-integration[bot] wants to merge 1 commit into
devfrom
devin/1791781400-security-findings
Closed

devin-ai-integration[bot] wants to merge 1 commit into
devfrom
devin/1791781400-security-findings

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Summary

  • Address the twelve supplied findings: validate original Bun PATH components and symlink ownership before probing; refuse symlink-target profile deletion and temporary desktop bundles; use bounded, nonblocking regular-file reads for integration and Desktop configuration.
  • Retain cancelled-turn admission until work unwinds, reauthorize Copilot Auto's negotiated model, enforce declared tools on translated Chat/Messages passthrough, and bound unfinished picker uploads. HTTP/1 refusals drain under deadlines to preserve response delivery.
  • Make diagnostic restart handling inert and arm the test-home guard. Replace overflow-message suffix rescanning and per-blob replay-history rescanning with bounded/one-pass processing.
  • Add regression tests and update the affected architecture contracts. No release, deployment, or merge is performed.

Verification

  • Windows focused follow-up: bun test tests/claude-integration/claude-prompt-too-long.test.ts tests/claude-integration/claude-native-reasoning-provenance.test.ts — 31 passed, 132 expectations, using pinned Bun 1.4.0.
  • bun run typecheck, bun run privacy:scan, bun run structure:check, and bun test tests/test-layout.test.ts tests/test-layout-tooling.test.ts passed during implementation; exact-head confirmation and the complete focused-check ledger are being finalized.
  • git diff --check passed.
  • bun run test:changed did not complete: its 900-second limit expired after launching 1,676 of 2,237 selected files. This is not a passing result. The full local suite is disproportionately expensive; focused regressions plus exact-head CI are the validation scope.
  • cargo fmt --manifest-path scripts/diagnostics/windows-version-control/Cargo.toml --check passed. Windows Rust Clippy currently fails to link kernel32.lib after MSVC installation; SDK environment repair and async_contracts execution are pending.
  • Separate macOS/POSIX validation of this branch is pending. Windows-skipped FIFO/symlink and native bundle tests are not claimed as passing.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed.
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Exact-head CI and platform validation must finish before merge.

Link to Devin session: https://app.devin.ai/sessions/0f01892c4cf0467eadea3119e10e09be
Open in Devin Desktop: https://app.devin.ai/desktop/session/0f01892c4cf0467eadea3119e10e09be?variant=devin
Requested by: @luvs01


Devin Review

Co-Authored-By: Epinephrine <luvs01@hanmail.net>
@devin-ai-integration

Copy link
Copy Markdown
Author

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

@coderabbitai

coderabbitai Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Important

Review skipped

This PR was authored by a bot without an assigned CodeRabbit review seat. Ask an organization administrator to assign a seat to the bot. See the seat-assignment guide. After the seat is assigned, request a review again.

⚙️ Run configuration
  • Configuration used: Repository: luvs01/opencodex/.coderabbit.yaml
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 9b68b3bc-6280-4375-8700-d834756231ff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔄 Devin is addressing Devin Review findings

Devin Review found 1 bug and 1 security issue on c9787aa. Devin is making a first pass at them and will update this comment once it's done.

View findings · Follow Devin's work

Devin Review

Comment on lines +107 to +109
.chain(std::iter::once(temp_dir))
.any(|root| path.starts_with(root))
|| path.starts_with("/Volumes")

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Custom temp root blocks installed apps

When TMPDIR names a user's home, stable_bundle rejects the installed app under that home's Applications directory. The environment-derived root matches the stable bundle path, so Desktop cannot register its bundled command.

Learn more

The bundle check runs before validating a normal macOS app under Applications. std::env::temp_dir() follows the process environment, so its value is not necessarily a dedicated temporary directory. A temporary root that contains a stable install path makes the stable install look temporary even after canonicalization.

Example: Alice has TMPDIR=/Users/alice and runs /Users/alice/Applications/OpenCodex.app/Contents/MacOS/OpenCodex. The executable starts with the reported temporary root, so command registration refuses the installed app.

Recommended fix: Restrict the dynamic temporary root to recognized temporary locations, or explicitly preserve installed Applications paths before applying that root. Add a test with TMPDIR set to an ancestor of a stable user Applications bundle.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

const copilotRequestedModel = route.modelId;
/** Project only bounded Copilot refusal metadata; upstream bodies and session tokens never reach the client. */
const copilotRefusalResponse = (error: unknown): Response | undefined => {
if (error instanceof AdmissionModelDeniedError) return admissionModelDeniedResponse(error);

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟥 Copilot scope refusal enters provider recovery

When resolveCopilotSelection denies a renegotiated model during dispatch, copilotRefusalResponse returns its 403 as an upstream result. Provider recovery can then process the admission denial as a provider refusal instead of ending the scoped request.

Recommendation: Propagate admission denials as a distinct terminal result through dispatch and retry layers; never return them as provider fetch Responses, and prohibit retries/failovers after the denial.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

@luvs01

luvs01 commented Oct 12, 2026

Copy link
Copy Markdown
Owner

Closing this aggregate in favor of the published split PRs. The original production changes have been mapped to the following replacements:

The replacement is by behavior and regression coverage, not a byte-for-byte copy: cancellation tests were folded into the existing disconnect suite, inbound-wire tool tests moved to a sibling file, and #717 uses the real two-server route regression instead of the aggregate's extra fixture commands. ZCode intentionally reuses the integration reader's 4 MiB limit rather than adding a separate 1 MiB policy.

This closes only the duplicate aggregate. It does not merge or approve the split PRs, close Security Cloud findings, or claim that native-platform validation or required CI has completed. Outstanding review threads and the documented test/environment limitations remain with their respective split PRs.

@luvs01 luvs01 closed this Oct 12, 2026
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