fix(jike): review follow-up — close residual URL-injection gap, surface auth/export in help#3
Draft
MidnightDarling wants to merge 1 commit into
Conversation
Follow-up hardening stacked on the ARFD-365 export/packaging work: - safe_url: reject URLs containing raw whitespace/newlines. clean() keeps "\n"/"\t", so an embedded newline in a link/image URL could break out of "[title](url)" and smuggle a second javascript:-scheme link onto the next line, bypassing the scheme allowlist on lenient Markdown renderers. - jike --help / -h: print the full command list including `auth` and `export`, which were intercepted before argparse and thus undiscoverable from top-level help. - .claude-plugin/marketplace.json: use the documented owner.url field instead of the non-standard owner.github key. - tests: cover newline-URL rejection, image size cap (header + streamed), non-image Content-Type rejection, and `jike --help`. https://claude.ai/code/session_01EhZKJSKTZZEnFJNeo6NWbG
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
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
本 PR 是对 #2(ARFD-365 export/打包加固) 的审查跟进,叠加在其分支之上,只包含审查中发现的、可安全落地的补强项。#2 主体经实测质量很高(166→172 测试通过、ruff/bandit/pip-audit 全绿、wheel 内容完整、4 个 console script 可用、插件清单符合 Claude Code + Codex 最新规范),本 PR 不重写其设计,仅补三处缺口。
完整审查结论已发布在 Linear ARFD-365。
改动 / Changes
[安全]
safe_url拒绝含空白/换行的 URL(src/jike/export_utils.py)clean()会保留\n/\t,导致带换行的linkInfo.linkUrl/picUrl可在 Markdown[title](url)中换行,把第二个javascript:-scheme 链接挤到下一行,在宽松渲染器上绕过 scheme 白名单。这是 fix(jike): harden export and plugin packaging #2 的 HTML/scheme 转义修复的残留缺口,现已堵住。[可用性]
jike --help/-h列出全部命令(src/jike/__main__.py)auth与export在 argparse 之前被拦截,导致顶层 help 不显示——用户发现不了最关键的两个命令。现在打印完整命令清单。jike(无参)仍 exit 1 到 stderr。[配置规范]
owner.url取代非标准owner.github(.claude-plugin/marketplace.json)Claude Code marketplace owner 文档字段为 name/email/url;改用
url。[测试] 补齐覆盖缺口:换行 URL 拒绝、图片大小上限(header + 流式)、非图片 Content-Type 拒绝、
jike --help。验证 / Verification
ruff check src scripts tests✓pytest✓ 172 passed(原 166 + 6 新增)jike --help实测列出 auth/export(exit 0);jike无参 exit 1https://claude.ai/code/session_01EhZKJSKTZZEnFJNeo6NWbG
Generated by Claude Code