fix: avoid vsce secret scanner false positive on regex patterns#6247
Conversation
Use character class `[b]` instead of literal `b` in Slack token regex patterns to prevent vsce's secret scanner from detecting `xoxb-` as a real Slack bot token during VSIX packaging. The regex semantics are unchanged — `[b]` is equivalent to `b` in a character class, but the built string no longer contains the continuous `xoxb-` substring that triggers the scanner. Fixes QwenLM#6199
|
Thanks for the PR, @yiliang114! (Re-run after additional commits.) Template: the PR uses custom headings (Summary / Background / Files Changed / Test plan) instead of the template headings (What this PR does / Why it's needed / Reviewer Test Plan / Risk & Scope). The content is all there and clear, so not blocking on this — but please use the template headings next time so reviewers can find info at a glance. On direction: solid build fix. On approach: minimal and correct. Moving on to code review and testing. 🔍 中文说明感谢 @yiliang114 的 PR!(追加提交后重新审查。) 模板:PR 使用了自定义标题(Summary / Background / Files Changed / Test plan),而非模板要求的标题。内容完整清晰,不阻塞——但下次请使用模板标题方便审阅。 方向:靠谱的构建修复。 方案:最小且正确。 进入代码审查和测试 🔍 — Qwen Code · qwen3.7-max |
|
Code review: Clean. The change is exactly what's described — I verified there are no other Unit tests (on PR branch): All 68 tests pass (29 secret-scanner + 39 logRedaction), including the new Regex equivalence (independent verification): CI: All 7 required checks pass (14 skipped, 0 failing). Full matrix green. No blocking issues. Moving to final decision. 中文说明代码审查: 干净。改动正如描述——两个源文件中的 额外检查:生产源码文件中是否还有其他 单元测试(PR 分支): secret-scanner 29/29 通过,logRedaction 39/39 通过(含新增的 正则等价性(独立验证): 9 个测试用例全部通过,零偏差。 CI: 7 项必需检查全部通过(14 项跳过,0 项失败)。 无阻塞问题。进入最终判定。 — Qwen Code · qwen3.7-max |
|
This is a clean, minimal fix that does exactly what it says. Two source files changed, both regex patterns semantically equivalent to the originals, solving a real blocker for the release pipeline. The follow-up commits (explanatory comments, The approach matches what I'd have proposed independently — The author also independently verified that Approving. Ship it. ✅ 中文说明干净、最小化的修复,完全如描述所述。两个源文件改动,正则模式语义均与原始代码等价,解决了发布流水线的真实阻塞问题。后续提交(解释性注释、 方案与我的独立提案一致—— 作者还独立验证了 批准。可以合入。✅ — Qwen Code · qwen3.7-max |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
|
Small readability follow-up: the I also verified the actual failure path from #6199 on the latest PR head npm ci
UNIVERSAL_BUILD=false VSCODE_TARGET=linux-x64 npm --workspace=qwen-code-vscode-ide-companion run prepackage
cd packages/vscode-ide-companion
../../node_modules/.bin/vsce package --no-dependencies --target linux-x64 --out ../../qwen-code-vscode-companion-0.19.5-linux-x64.vsixResult: I also checked the staged extension payload directly: rg -n "xoxb-|xoxp-" packages/vscode-ide-companion/dist/qwen-cliThat returned no matches. The bundled output now contains only |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
No issues found. Downgraded from Approve to Comment: CI still running.
— qwen3.7-max via Qwen Code /review
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
No review findings. Downgraded from Approve to Comment: CI still running.
— qwen3.7-max via Qwen Code /review
|
@qwen-code /triage |
qwen-code-ci-bot
left a comment
There was a problem hiding this comment.
LGTM, looks ready to ship. ✅
wenshao
left a comment
There was a problem hiding this comment.
No issues found. LGTM! ✅
— qwen3.7-max via Qwen Code /review
| expect(redactLogCredentials(token)).toBe(R); | ||
| }); | ||
|
|
||
| it('redacts Slack user access tokens', () => { |
There was a problem hiding this comment.
[Suggestion] This test proves xoxp- tokens still redact, but it does not guard the release failure this PR fixes: a future change could simplify the source regexes back to raw Slack prefixes and all matching tests would still pass. Please add a focused regression assertion that the regex sources, or the built bundle, do not contain the raw prefixes; construct the forbidden strings via concatenation so the test itself does not trip scanners.
— GPT-5 via Qwen Code /review
Summary
[b]instead of literalbin Slack token regex patterns (xoxb-→xox[b]-,xoxp-→xox[p]-)[b]is equivalent tobin a character classBackground
Release VSCode IDE Companionworkflow fails on v0.19.5 becausevsce packagedetectsxoxb-in the bundleddist/qwen-cli/chunks/chunk-2Z43HUXT.jsas a potential Slack bot token. The string originates fromsecret-scanner.tsregex patterns, not from an actual secret.Files Changed
packages/core/src/memory/secret-scanner.ts:95xoxb-→xox[b]-packages/acp-bridge/src/logRedaction.ts:46xoxb-→xox[b]-,xoxp-→xox[p]-Test plan
new RegExp('xox[b]-...')matches the same inputs asnew RegExp('xoxb-...')secret-scannerunit tests to confirm no regressionvsce package --dry-runto confirm the scanner no longer flags the bundleFixes #6199