Skip to content

fix(policy): block POST to sentry.io to prevent multi-tenant data exfiltration (#1437)#1623

Closed
cv wants to merge 4 commits intomainfrom
fix/1437-sentry-block-post-exfiltration
Closed

fix(policy): block POST to sentry.io to prevent multi-tenant data exfiltration (#1437)#1623
cv wants to merge 4 commits intomainfrom
fix/1437-sentry-block-post-exfiltration

Conversation

@cv
Copy link
Copy Markdown
Contributor

@cv cv commented Apr 8, 2026

Summary

Closes #1437. Supersedes #1565.

  • Removes the two path-scoped POST rules (/api/*/envelope/** and /api/*/store/**) from the sentry.io endpoint in the sandbox network policy
  • Retains GET /** for read-only Sentry SDK paths (DSN config fetching) — GET has no request body and is bounded by URL length limits, making it harmless for bulk exfiltration
  • The path-scoped POST rules were insufficient because the Sentry project ID is part of the URL and attacker-controlled — a compromised agent could POST data to any Sentry project

Credit to @ColinM-sys for the original analysis and fix in #1565.

Test plan

  • Verify sentry.io endpoint in nemoclaw-blueprint/policies/openclaw-sandbox.yaml has only a GET rule, no POST
  • Run npm test to confirm no test regressions
  • Verify policy YAML is syntactically valid

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Modified sandbox network policies to restrict POST requests to external services, while maintaining GET access permissions.

ColinM-sys and others added 4 commits April 7, 2026 01:31
…iltration

sentry.io is a multi-tenant SaaS — any client with a project ID can POST
to any Sentry project, not just NemoClaw's. The baseline sandbox policy
allowed POST to sentry.io with path '/**', which turned the host into a
generic exfiltration channel: a compromised agent inside the sandbox
could ship stack traces, env vars, file contents, etc. to a Sentry
project controlled by an attacker via the public envelope endpoint
(https://sentry.io/api/<any-project-id>/envelope/). Path-pattern
restrictions cannot fix this because the project ID is part of the URL
and there is no server-side allowlist of legitimate projects.

This is a follow-up to #1214 (which added 'protocol: rest' for
sentry.io) — that PR closed the wire-protocol gap, this PR closes the
remaining HTTP-method-level gap.

Changes:

- nemoclaw-blueprint/policies/openclaw-sandbox.yaml: drop the
  'method: POST, path: /**' allow rule for sentry.io. GET stays
  allowed because GET has no request body and is harmless for exfil.
  Side effect: Claude Code's crash telemetry to Sentry is silently
  dropped. That is the correct tradeoff for a sandbox whose stated
  goal is preventing data egress, and the sandbox already blocks many
  similar telemetry channels by default.

- test/validate-blueprint.test.ts: walk every endpoint in
  network_policies, find sentry.io, and assert (a) at least one
  sentry.io entry exists, (b) no sentry.io entry has a POST allow
  rule, (c) the GET allow rule is preserved. Verified by stashing
  the policy fix and re-running: the test correctly fails on main
  with the unfixed policy, and passes with the fix in place.

Closes #1437
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
…1437)

The path-scoped POST rules (/api/*/envelope/** and /api/*/store/**)
do not prevent multi-tenant exfiltration because the Sentry project ID
is part of the URL and attacker-controlled. Remove POST entirely so the
endpoint is connection-only with no allowed methods.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
GET has no request body and is bounded by URL length limits, making it
harmless for bulk exfiltration. Keeping it allows read-only Sentry SDK
code paths (e.g. fetching public DSN config) to continue working.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@cv cv added security Something isn't secure priority: high Important issue that should be resolved in the next release fix policy v0.0.10 Release target labels Apr 8, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 8, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: c2aa6f67-fb73-4e8b-84b1-3b2a4539c4ff

📥 Commits

Reviewing files that changed from the base of the PR and between e2bfdcf and 7047de6.

📒 Files selected for processing (1)
  • nemoclaw-blueprint/policies/openclaw-sandbox.yaml

📝 Walkthrough

Walkthrough

The sandbox network policy for sentry.io is modified to restrict outbound traffic. POST requests to specific Sentry endpoints are removed, while GET access remains. This eliminates a data exfiltration vector where error reports could be sent to attacker-controlled Sentry projects.

Changes

Cohort / File(s) Summary
Sentry Network Policy
nemoclaw-blueprint/policies/openclaw-sandbox.yaml
Restricts sentry.io network access from allowing POST to /api/*/envelope/** and /api/*/store/** to only permitting GET requests. Removes ability to exfiltrate sandbox data via Sentry error reporting endpoints.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 A Sentry once stood with arms open wide,
POST requests flowing with nowhere to hide,
But we've closed the door (yet kept window pane),
Now only GET whispers, no data drain! 📬✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: blocking POST requests to sentry.io to prevent data exfiltration. It directly reflects the primary objective of the changeset.
Linked Issues check ✅ Passed The PR successfully addresses issue #1437 by removing POST allow rules for sentry.io while preserving GET for read-only operations, matching all stated objectives and requirements.
Out of Scope Changes check ✅ Passed The changes are scoped exclusively to the sentry.io network policy configuration in the sandbox YAML file, with no extraneous or unrelated modifications present.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/1437-sentry-block-post-exfiltration

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

@cv
Copy link
Copy Markdown
Contributor Author

cv commented Apr 8, 2026

Reverting to #1565 — the contributor's PR should stay open so a maintainer can review it.

@cv cv closed this Apr 8, 2026
@cv cv deleted the fix/1437-sentry-block-post-exfiltration branch April 8, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix policy priority: high Important issue that should be resolved in the next release security Something isn't secure v0.0.10 Release target

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sentry.io Allowed in Baseline Policy With POST to /** — Potential Data Exfiltration - IssueFinder - SN 13

2 participants