Skip to content

fix(jike): review follow-up — close residual URL-injection gap, surface auth/export in help#3

Draft
MidnightDarling wants to merge 1 commit into
codex-arfd-365-jike-hardeningfrom
claude/jolly-brahmagupta-5opB6
Draft

fix(jike): review follow-up — close residual URL-injection gap, surface auth/export in help#3
MidnightDarling wants to merge 1 commit into
codex-arfd-365-jike-hardeningfrom
claude/jolly-brahmagupta-5opB6

Conversation

@MidnightDarling
Copy link
Copy Markdown
Owner

概述 / 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

  1. [安全] 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 转义修复的残留缺口,现已堵住。

  2. [可用性] jike --help / -h 列出全部命令(src/jike/__main__.py)
    authexport 在 argparse 之前被拦截,导致顶层 help 不显示——用户发现不了最关键的两个命令。现在打印完整命令清单。jike(无参)仍 exit 1 到 stderr。

  3. [配置规范] owner.url 取代非标准 owner.github(.claude-plugin/marketplace.json)
    Claude Code marketplace owner 文档字段为 name/email/url;改用 url

  4. [测试] 补齐覆盖缺口:换行 URL 拒绝、图片大小上限(header + 流式)、非图片 Content-Type 拒绝、jike --help

验证 / Verification

  • ruff check src scripts tests
  • pytest172 passed(原 166 + 6 新增)
  • 4 个 plugin manifest JSON 均合法
  • jike --help 实测列出 auth/export(exit 0);jike 无参 exit 1

https://claude.ai/code/session_01EhZKJSKTZZEnFJNeo6NWbG


Generated by Claude Code

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
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 29, 2026

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f0e9c84a-1e67-47fa-b7f4-a8b3a2c203ea

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch claude/jolly-brahmagupta-5opB6

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.

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.

2 participants