Skip to content
This repository was archived by the owner on May 13, 2026. It is now read-only.

[codex] fix security advisory and toolcall parsing issues#476

Merged
CJackHwang merged 4 commits into
devfrom
codex/fix-security-advisory-ghsa-rf34-c5jc-4ffw
May 10, 2026
Merged

[codex] fix security advisory and toolcall parsing issues#476
CJackHwang merged 4 commits into
devfrom
codex/fix-security-advisory-ghsa-rf34-c5jc-4ffw

Conversation

@CJackHwang
Copy link
Copy Markdown
Owner

@CJackHwang CJackHwang commented May 10, 2026

Summary

Fixes the two low-severity issues reported in GHSA-rf34-c5jc-4ffw and tightens adjacent tool-call parsing edge cases:

  • Tightens WebUI static fallback path containment so sibling directories with the same prefix cannot pass the directory boundary check.
  • Redacts Gemini-compatible key and api_key query parameters before access logs are emitted, without mutating the live request.
  • Adds fallback raw-query redaction for malformed query strings such as ?key=secret;alt=sse and ?api_key=secret%ZZ, so sensitive values do not leak when url.ParseQuery fails.
  • Treats Markdown inline code spans like fenced code blocks for executable tool-call detection, including stream chunks split across the opening backtick, tool XML, and closing backtick.
  • Preserves literal backticks inside real tool parameters, for example shell commands like ``echo `date```.
  • Adds Go and Node regression tests for the redaction and tool-call parsing cases.

Root Cause

The WebUI fallback used a raw prefix check against staticDir, which did not require a path separator boundary. The access logger delegated to chi's default formatter with the full RequestURI, including sensitive query parameters used by Gemini-compatible clients; the first redaction pass also returned unredacted output when query parsing failed before producing parsed pairs.

For tool calls, inline Markdown examples were only partially ignored. Non-stream parsing originally stripped inline code spans too broadly, which could remove backticks from real parameter values, while stream detection did not carry inline-code state across chunks.

Validation

  • ./scripts/lint.sh
  • ./tests/scripts/check-refactor-line-gate.sh
  • ./tests/scripts/run-unit-all.sh
  • npm run build --prefix webui

CJackHwang and others added 2 commits May 10, 2026 16:33
feat: enhance DSML tool-call parsing drift tolerance and update API docs
@vercel
Copy link
Copy Markdown

vercel Bot commented May 10, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
ds2api Ready Ready Preview, Comment May 10, 2026 10:06am

@CJackHwang CJackHwang changed the base branch from main to dev May 10, 2026 09:02
@CJackHwang CJackHwang marked this pull request as ready for review May 10, 2026 09:06
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 243860f6d3

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread internal/server/router.go Outdated
@CJackHwang CJackHwang changed the title [codex] fix security advisory issues [codex] fix security advisory and toolcall parsing issues May 10, 2026
@CJackHwang CJackHwang merged commit 8623920 into dev May 10, 2026
8 checks passed
@CJackHwang CJackHwang deleted the codex/fix-security-advisory-ghsa-rf34-c5jc-4ffw branch May 10, 2026 10:06
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant