Skip to content

fix(security): resolve CodeQL polynomial ReDoS and scope SAST analysis - #10

Merged
divyanshujethi merged 1 commit into
mainfrom
fix/codeql-sast-remediation
Nov 7, 2026
Merged

divyanshujethi merged 1 commit into
mainfrom
fix/codeql-sast-remediation

Conversation

@divyanshujethi

Copy link
Copy Markdown
Collaborator

Summary of Changes

Remediates all CodeQL SAST security alerts detected on initial repository scan:

  1. Refactored GraphQL & Protobuf Parsers (src/proto-graphql.ts):
    • Converted multiline greedy regexes into single-pass line-by-line streaming parsers, fully eliminating polynomial ReDoS vulnerabilities (Alerts #34-#41).
  2. Hardened OpenAPI Path & Name Normalizers (src/openapi.ts, src/devshelf-export.ts):
    • Swapped unbounded regexes with strict alphanumeric path extraction and safe string trimming (Alerts #33, #42).
  3. Python Template Sanitization (src/templates/python.ts):
    • Fixed incomplete sanitization by escaping backslashes before double quotes in pyproject.toml descriptions (Alert #44).
    • Replaced leading/trailing underscore regex with linear trimming (Alert #43).
  4. CodeQL Scoping (.github/codeql/codeql-config.yml):
    • Explicitly configured CodeQL to target production source files (src/) while excluding unit test suites ( ests/).

- Refactor GraphQL SDL and Protobuf parsers to single-pass linear parsers to eliminate polynomial ReDoS
- Harden OpenAPI path parameter regex and python package name sanitization against ReDoS
- Fix backslash escaping in Python pyproject.toml template description
- Add .github/codeql/codeql-config.yml to focus security analysis on production src directory
@github-actions

github-actions Bot commented Nov 7, 2026

Copy link
Copy Markdown

👋 Thanks for opening this Pull Request, @divyanshujethi!

Thank you for contributing to MCP Builder Kit! ⚡

Here is what happens next:

  1. 🧪 Automated CI Tests: Our workflow is verifying build pipelines and TypeScript types.
  2. 🔍 Code Review: A maintainer from @RitualDev-Lab will review your changes shortly.
  3. 🌟 Contributor Recognition: Once merged, you'll be featured on our contributors list!

💡 Tip: Make sure your commits follow Conventional Commits and tests pass locally (pnpm test).

@divyanshujethi
divyanshujethi merged commit 8d9a117 into main Nov 7, 2026
11 checks passed
@divyanshujethi
divyanshujethi deleted the fix/codeql-sast-remediation branch November 7, 2026 18:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant