Skip to content

fix(security): SSRF-safe cloud callbacks with pinned DNS and log sanitization - #1686

Draft
linear-code[bot] wants to merge 1 commit into
mainfrom
execution-harden-cloud-callback-ssrf-and-log-grv-93-186b
Draft

fix(security): SSRF-safe cloud callbacks with pinned DNS and log sanitization#1686
linear-code[bot] wants to merge 1 commit into
mainfrom
execution-harden-cloud-callback-ssrf-and-log-grv-93-186b

Conversation

@linear-code

@linear-code linear-code Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

Recreates the PR #734 cloud-callback hardening on a fresh branch cut from current main, so the change carries clean provenance (the original PR is blocked only by its historical pre-dispatch boundary, not by code issues).

Changes to src/youtube_extension/backend/cloud_api_endpoints.py (+ tests in tests/unit/test_cloud_routes.py):

  • Resolve the callback host once, off the event loop; reject malformed URLs and any non-global destination (private, loopback, link-local, CGNAT, IPv6 site-local), failing closed on mixed public/private DNS answers.
  • Pin connections to the validated numeric addresses while preserving Host header, port, TLS SNI, hostname certificate verification, disabled redirects, and async I/O — closing the DNS-rebinding window.
  • Bound dispatch to at most three resolved addresses under a single deadline, and never retry a POST that may already have been transmitted.
  • CR/LF-sanitize untrusted callback values and exception values before logging; client-facing 500 details stay static.

The PR #734 diff was applied onto current main with a 3-way merge; the intervening #1361 change (Cloud Tasks auth before payload validation) is preserved alongside the hardening. Note: the session was cut off before the focused suite (tests/unit/test_cloud_routes.py) could run in this environment — please rely on CI for verification. The same diff passed CI, Coverage, CodeQL, Security/Secret scans, Dependency Review, and CodeRabbit review at PR #734's head (122 focused tests passed there).

…tization

Recreate the PR #734 hardening on a fresh main-based branch: resolve
callback hosts once off-loop, reject non-global/mixed DNS answers, pin
connections to validated numeric addresses (preserving Host/SNI/hostname
verification and disabled redirects), bound dispatch to three addresses
under one deadline without retrying a transmitted POST, and CR/LF-sanitize
untrusted callback and exception log values.

Generated with [Linear](https://linear.app/myxstack/agent-session/f979788e-1a9c-463c-8f45-146d3c1ec52e)

Co-authored-by: linear-code[bot] <222613912+linear-code[bot]@users.noreply.github.com>
@linear-code

linear-code Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

GRV-93

@vercel

vercel Bot commented Sep 8, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
v0-uvai Canceled Canceled v0 Sep 8, 2026 4:04pm UTC

@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

🔍 PR Validation

⚠️ Large PR detected (519 lines changed)

@github-actions github-actions Bot added the python label Sep 8, 2026
@github-actions

github-actions Bot commented Sep 8, 2026

Copy link
Copy Markdown

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Snapshot Warnings

⚠️: No snapshots were found for the head SHA ab5498d.
Ensure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice.

Scanned Files

None

f"(async={request.async_processing}, priority={request.priority})"
"🎬 Cloud processing request: %s (async=%s, priority=%s)",
_sanitize_log_value(request.video_url),
request.async_processing,
"🎬 Cloud processing request: %s (async=%s, priority=%s)",
_sanitize_log_value(request.video_url),
request.async_processing,
request.priority,
@groupthinking groupthinking added high-priority Urgent - blocks revenue or core functionality agent-task mcp/agent labels Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agent-task high-priority Urgent - blocks revenue or core functionality mcp/agent python

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants