fix(security): resolve Python warning-severity CodeQL alerts (#3164)#3204
Merged
mrveiss merged 2 commits intoDev_new_guifrom Apr 1, 2026
Merged
fix(security): resolve Python warning-severity CodeQL alerts (#3164)#3204mrveiss merged 2 commits intoDev_new_guifrom
mrveiss merged 2 commits intoDev_new_guifrom
Conversation
- py/bad-tag-filter: replace regex HTML stripping with html.parser in knowledge.py - py/regex-injection: use re.escape() for config-driven patterns in domain_security.py - py/polynomial-redos: fix backtracking in email/URL patterns (metadata.py), ANSI escape patterns (encoding_utils.py), analytics slug regex, and docstring detection patterns (semantic_analyzer.py) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Owner
Author
Code reviewFound 2 issues:
AutoBot-AI/autobot-backend/api/analytics_controller.py Lines 64 to 68 in 2c09611
AutoBot-AI/autobot-backend/knowledge/metadata.py Lines 37 to 41 in 2c09611 🤖 Generated with Claude Code - If this code review was useful, please react with 👍. Otherwise, react with 👎. |
…upport (#3164) Restore bounded lookaheads in analytics slug pattern to prevent collapsing real word paths (e.g. /dashboard, /knowledge) into {id}. Fix URL validation to accept ports, query strings, and fragments per RFC 3986. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 1, 2026
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.
Summary
Alert types fixed
py/bad-tag-filterapi/knowledge.pyre.sub(r"<[^>]+>")withhtml.parser.HTMLParserpy/regex-injectionsecurity/domain_security.pyre.escape()on config-driven glob patternspy/polynomial-redosknowledge/metadata.py[a-zA-Z0-9-.]+→(?:[a-zA-Z0-9-]+)+)py/polynomial-redosutils/encoding_utils.py{0,1024}quantifier limitpy/polynomial-redosapi/analytics_controller.pypy/polynomial-redosservices/semantic_analyzer.py[\s\S]*with{0,5000}limitNot addressed in this PR (false positives / intentional design)
py/insecure-protocol(~4) — Allhttp://URLs are internal service-to-service communication on private networkspy/clear-text-logging-sensitive-data(~55) — CodeQL flags variable names liketoken/passwordbut no actual secrets are loggedpy/command-line-injection(~3) — Terminal executor and elevation wrapper intentionally run user commandspy/full-ssrf(2) — Already fixed in prior PRs (validate_url applied)Test plan
python -c "from html.parser import HTMLParser"passes🤖 Generated with Claude Code