fix(security): sanitize v1 router log inputs (CWE-117) — partial - #1691
Draft
linear-code[bot] wants to merge 1 commit into
Draft
fix(security): sanitize v1 router log inputs (CWE-117) — partial#1691linear-code[bot] wants to merge 1 commit into
linear-code[bot] wants to merge 1 commit into
Conversation
…-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>
Contributor
Author
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure 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 FilesNone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports the call-site log sanitization from #810 onto current
main. Adds a_safe_log()helper insrc/youtube_extension/backend/api/v1/router.pythat reuses the centralsanitize_log_recordtable fromlogging_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 theextra={"video_url": ...}site (~516)tests/unit/test_v1_router_extended.py