Skip to content

fix(security): sanitize v1 router log inputs (CWE-117) — partial - #1691

Draft
linear-code[bot] wants to merge 1 commit into
mainfrom
execution-sanitize-v1-router-log-inputs-cwe-117-pr-810-grv-95-c540
Draft

fix(security): sanitize v1 router log inputs (CWE-117) — partial#1691
linear-code[bot] wants to merge 1 commit into
mainfrom
execution-sanitize-v1-router-log-inputs-cwe-117-pr-810-grv-95-c540

Conversation

@linear-code

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

Copy link
Copy Markdown
Contributor

Ports the call-site log sanitization from #810 onto current main. Adds a _safe_log() helper in src/youtube_extension/backend/api/v1/router.py that reuses the central sanitize_log_record table from logging_config.py (already merged formatter-level hardening), and applies it to 35 f-string log interpolations of user-controlled values: exception text, video/job/action/agent IDs, chat messages, session IDs, and video URLs.

Incomplete — session was cut short by workspace funding limits. Still pending:

  • %s-style log arg sites (router.py lines ~140, ~1441, ~1461, ~1556, ~1647, ~1836) and the extra={"video_url": ...} site (~516)
  • Focused CR/LF and non-string regressions in tests/unit/test_v1_router_extended.py
  • Test run / lint verification (none run yet)

…-117)

Add _safe_log() helper (reusing sanitize_log_record from logging_config)
and apply it to f-string log interpolations of user-controlled values
(exceptions, video/job/action/agent IDs, messages, session IDs, URLs).

Partial: %s-style arg sites, extra= dict, and focused regressions in
tests/unit/test_v1_router_extended.py still pending.

Generated with [Linear](https://linear.app/myxstack/agent-session/40d7adf7-65c1-44da-869e-0f24ef588c46)

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-95

@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

Dependency Review

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

Snapshot Warnings

⚠️: No snapshots were found for the head SHA 9e4331e.
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

@github-actions github-actions Bot added the python label Sep 8, 2026
@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.

2 participants