Skip to content

chore(release): v5.1.2 — Security patch (CWE-95 SymPy injection fix)#201

Merged
Rahul Dass (rahuldass19) merged 1 commit into
mainfrom
release/v5.1.2
Jun 14, 2026
Merged

chore(release): v5.1.2 — Security patch (CWE-95 SymPy injection fix)#201
Rahul Dass (rahuldass19) merged 1 commit into
mainfrom
release/v5.1.2

Conversation

@rahuldass19

@rahuldass19 Rahul Dass (rahuldass19) commented Jun 14, 2026

Copy link
Copy Markdown
Member

v5.1.2 — Security Patch Release

This is an emergency patch release. Fixes a High severity (CVSS 8.8) authenticated RCE vulnerability (CWE-95) in SymPy's parse_expr() across all math verification paths.

Security

  • CWE-95 mitigation: Added safe_parse_expr() with denylist + stripped __builtins__ + allow-listed math namespace + per-call global dict copy + post-parse validation. Replaced all 17 direct parse_expr() call sites.
  • Calculus symbol consistency: Fixed n symbol mismatch causing incorrect diff/integrate/limit results.
  • Defense-in-depth: AST depth limits, SymPy tree validation, relational rejection, extra_symbols validation.

Included PRs

  • #197 fix(ts-sdk): lockfile restore
  • #198 ci: CodSpeed benchmarks
  • #199 fix(cache): fail-closed Redis backend
  • #200 fix(math): restrict SymPy expression parsing (CWE-95)

Version Bumps

Artifact 5.1.1 → 5.1.2
qwed (PyPI)
@qwed-ai/sdk (NPM)
qwed (Rust crate)
API version header
Docker image tag

Summary by CodeRabbit

  • Security

    • Emergency security patch for a critical authentication-based vulnerability.
    • Added defense-in-depth hardening: safer expression parsing, consistent symbol handling, stricter validation limits, rejection of unsupported relational expressions, and fail-closed caching behavior.
    • Strengthened release notes to document the security improvements in detail.
  • Chores

    • Bumped version to 5.1.2 across APIs, SDKs, Kubernetes deployment image tag, and documentation.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Jun 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 8dbe027c-04f8-4289-893d-889fcf1680e5

📥 Commits

Reviewing files that changed from the base of the PR and between 6eec53b and 818cfd2.

📒 Files selected for processing (8)
  • CHANGELOG.md
  • README.md
  • deploy/kubernetes/deployment.yaml
  • pyproject.toml
  • sdk-rust/Cargo.toml
  • sdk-rust/README.md
  • sdk-ts/package.json
  • src/qwed_new/api/main.py
✅ Files skipped from review due to trivial changes (8)
  • sdk-ts/package.json
  • deploy/kubernetes/deployment.yaml
  • sdk-rust/Cargo.toml
  • sdk-rust/README.md
  • pyproject.toml
  • src/qwed_new/api/main.py
  • CHANGELOG.md
  • README.md

📝 Walkthrough

Walkthrough

Version is bumped from 5.1.1 to 5.1.2 across all package manifests (pyproject.toml, sdk-rust/Cargo.toml, sdk-ts/package.json), the FastAPI APP_VERSION constant, the Kubernetes deployment image tag, and SDK documentation snippets. CHANGELOG.md and README.md are updated with release notes describing a SymPy parse_expr() RCE security patch.

Changes

v5.1.2 Release Bump

Layer / File(s) Summary
Changelog and README release notes
CHANGELOG.md, README.md
CHANGELOG.md adds an [Unreleased] marker and a full [5.1.2] entry covering the SymPy parse_expr() RCE mitigation, AST/tree validation, Redis fail-closed hardening, and included PRs. README.md replaces the v5.1.1 release blurb with matching v5.1.2 security bullet points and updated upgrade guidance.
Version bumps across manifests and runtime constant
pyproject.toml, sdk-rust/Cargo.toml, sdk-ts/package.json, src/qwed_new/api/main.py, sdk-rust/README.md, deploy/kubernetes/deployment.yaml
All version references are incremented from 5.1.1 to 5.1.2: Python project metadata, Rust crate manifest and its README install snippet, TypeScript package, the FastAPI APP_VERSION constant (propagates to /health and OpenAPI metadata), and the Kubernetes container image tag.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Possibly related PRs

  • QWED-AI/qwed-verification#196: Previous release PR that also bumps APP_VERSION in src/qwed_new/api/main.py alongside other changes.
  • QWED-AI/qwed-verification#156: Earlier release/version bump PR touching the same set of version surfaces (Python package, SDK manifests, Kubernetes image tag).

Poem

🐇 Hop, hop, patch is here!
A tiny bump from one to two,
SymPy's danger now subdued,
Safe parsing saves the day anew.
v5.1.2, secure and true! 🔒

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive The description comprehensively covers security fixes, symbol consistency, defense-in-depth measures, included PRs, and version bumps. However, the QWED Enforcement Checklist template items are not addressed in the description. Add explicit sections addressing the QWED Enforcement Checklist (no fallback execution, no raw eval/exec, verification enforcement, fail-closed behavior) to demonstrate compliance with QWED_RULES.md.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change as a security patch release (v5.1.2) addressing a CWE-95 SymPy injection vulnerability, which aligns directly with the primary objective.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch release/v5.1.2

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@socket-security

socket-security Bot commented Jun 14, 2026

Copy link
Copy Markdown

No dependency changes detected. Learn more about Socket for GitHub.

👍 No dependency changes detected in pull request

@codspeed-hq

codspeed-hq Bot commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 20 untouched benchmarks


Comparing release/v5.1.2 (818cfd2) with main (6066b68)

Open in CodSpeed

@codecov

codecov Bot commented Jun 14, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@README.md`:
- Around line 63-72: The security label in the Release Update section uses the
imprecise term "CVE-requested" which creates inconsistency with the CVSS 8.8
severity rating referenced in CHANGELOG.md. Replace or clarify the
"CVE-requested" text in the parentheses after "High severity" to use either a
specific CVE identifier (if one has been assigned) or align the wording with the
CVSS severity metric already documented elsewhere. Ensure the release note
maintains consistent security terminology throughout.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 470aff95-fee7-401f-90de-a36f5b4109fe

📥 Commits

Reviewing files that changed from the base of the PR and between 6066b68 and 6eec53b.

⛔ Files ignored due to path filters (1)
  • sdk-ts/package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (8)
  • CHANGELOG.md
  • README.md
  • deploy/kubernetes/deployment.yaml
  • pyproject.toml
  • sdk-rust/Cargo.toml
  • sdk-rust/README.md
  • sdk-ts/package.json
  • src/qwed_new/api/main.py

Comment thread README.md
@greptile-apps

greptile-apps Bot commented Jun 14, 2026

Copy link
Copy Markdown

Greptile Summary

This is the v5.1.2 release PR, bumping version strings across all eight artefacts (PyPI, NPM, Rust crate, Docker image, API header, docs) after the CWE-95 security fix was already merged in PR #200. The diff itself only touches version identifiers; the substantive safe_parse_expr wrapper and the replacement of all direct parse_expr call sites landed in prior commits.

  • Version consistency: All eight files are aligned at 5.1.2 — pyproject.toml, sdk-ts/package.json, sdk-rust/Cargo.toml, deploy/kubernetes/deployment.yaml, APP_VERSION in main.py, CHANGELOG, and both READMEs.
  • Security fix (already merged): safe_parser.py wraps parse_expr with a denylist, stripped __builtins__, allow-listed math namespace, AST/SymPy depth limits, and post-parse type enforcement; all call sites in main.py, verifier.py, batch.py, and validator.py use it.
  • Minor gap: The wrap_error docstring in exceptions.py still shows bare sympy.parse_expr() as its usage example, which is stale after the security migration.

Confidence Score: 5/5

Safe to merge — the diff is version-string-only, and the underlying security fix was validated and merged before this release PR was opened.

Every changed line in this PR is a version identifier (5.1.1 → 5.1.2). The safe_parse_expr implementation and all call-site replacements are in the base branch and are not touched here. The only stale artefact is a docstring example in exceptions.py that was outside this PR's diff entirely.

No files in the diff require special attention; src/qwed_new/core/exceptions.py (outside the diff) has a stale docstring example worth updating in a follow-up.

Important Files Changed

Filename Overview
src/qwed_new/api/main.py Only the APP_VERSION string is updated (5.1.1 → 5.1.2); the safe_parse_expr integration at lines 460–504 was already merged via PR #200 and is unchanged here.
pyproject.toml Version bumped from 5.1.1 to 5.1.2; no other changes.
sdk-ts/package.json Package version bumped from 5.1.1 to 5.1.2; no other changes.
sdk-rust/Cargo.toml Crate version bumped from 5.1.1 to 5.1.2; no other changes.
deploy/kubernetes/deployment.yaml Docker image tag updated from qwed-verification:5.1.1 to qwed-verification:5.1.2; no other changes.
CHANGELOG.md New 5.1.2 entry documents the CWE-95 fix; the claim that all 17 parse_expr call sites were replaced is slightly undercut by a stale docstring example in exceptions.py that still shows the unsafe pattern.
README.md Release notes section updated to describe v5.1.2 security patch; no code changes.
sdk-rust/README.md Cargo.toml dependency example updated to reference qwed 5.1.2; no other changes.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[User expression string] --> B{Type and length check}
    B -- fail --> ERR[SafeParserError]
    B -- pass --> C{Denylist regex scan}
    C -- match --> ERR
    C -- no match --> D{AST depth check max 30}
    D -- exceeds --> ERR
    D -- pass --> E[Build safe local_dict]
    E --> F[Copy global_dict with empty builtins]
    F --> G[sympy parse_expr]
    G --> H{Post-parse validation}
    H -- fail --> ERR
    H -- pass --> OK[Return SymPy expression]
Loading

Reviews (2): Last reviewed commit: "chore(release): bump version to 5.1.2" | Re-trigger Greptile

- Bump core APP_VERSION, pyproject.toml, sdk-ts/package.json,
  sdk-rust/Cargo.toml, sdk-rust/README.md, k8s deployment image tag
- Add CHANGELOG entry for v5.1.2 (CWE-95, CVSS 8.8)
- Update README release section
@sonarqubecloud

Copy link
Copy Markdown

@rahuldass19 Rahul Dass (rahuldass19) merged commit 7be2dc6 into main Jun 14, 2026
41 checks passed
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