Skip to content

fix: 全領域監査で検出した表示・検索・サーバーの不具合を修正 - #27

Merged
simota merged 2 commits into
mainfrom
fix/comprehensive-audit-20260913
Sep 13, 2026
Merged

simota merged 2 commits into
mainfrom
fix/comprehensive-audit-20260913

Conversation

@simota

@simota simota commented Sep 13, 2026 •

Copy link
Copy Markdown
Owner

修正内容

不正な入力でのサーバー終了、公開範囲外の symlink 読み込み、正規表現検索による停止、HTML 画像保存時の sandbox 権限拡大、非同期応答による画面の上書き、データ表示と機密マスクの欠落を修正します。

  • サーバー / CLI: JSON をバイト単位で安全に読み込み、raw URL と diagram 入力を検証。検索・backlinks・gallery・CSS の symlink 境界、IPv6、ZIP 重複名、ignore、隠しファイル監視、OS opener と終了処理を修正。正規表現検索を Worker に隔離し、1 ファイル 1 秒で打ち切ります。
  • 画面 / 検索: 読み込み世代と DOM 所有状態を使い、メイン・分割・アルバム・表の古い応答を破棄。検索キャンセル、URL バーの存在確認、見出し / 相対 URI / remote URL、共有リンク、巨大行範囲、動画表示を修正します。
  • 描画 / データ: HTML は opaque origin のプレビューから DOM を受け取り、スクリプト禁止 iframe で保存。読み取り可能な Canvas も保持します。Marp 判定・Wiki link・Mermaid の残存 SVG、CSV 原文と数値ソート、複数行レコード、JSONL 行番号、循環 YAML、Source を含む Secret Safe を修正します。
  • 画像 / テーマ: SVG パネル、WebP / PNG / SVG 寸法解析、ライトボックスの中断と後片付け、コピー失敗表示、既存コントラスト検査の 11 失敗を修正します。
  • 依存 / 配布: 互換範囲のセキュリティ更新、C2PA 任意依存化、npm-shrinkwrap、Node 20.19.0 / 22 の CI を追加します。

詳細な不具合一覧・対象範囲・制約は 監査記録 を参照してください。

検証

GitHub Actions は最終コミット a5ea3840ea3eae3a6fe7af9ba1dd744025e68963 で成功しました。

検証 Node 20.19.0 Node 22
npm ci / prepare build(TypeScript strict を含む) 成功 成功
npm run test:unit 22 件成功 22 件成功
npm run check:contrast 300 件成功 300 件成功
Chromium / Playwright 全体 375 件成功・3 件スキップ 375 件成功・3 件スキップ
  • 回帰テストを 79 件追加(Node 22 件、Playwright 57 件)。Playwright は合計 378 件 / 29 ファイルです。
  • 3 件のスキップは既存の EXIF / GPS / C2PA 署名付き画像テストです。必要な画像 fixture または native 機能が未用意で、成功件数には含めていません。
  • npm audit: リポジトリの固定依存環境で 14 件 → 0 件。
  • 独立コピーで通常の npm ci と prepare build を確認しました。
  • sharp 更新は実際の C2PA thumbnail API(JPEG / PNG)、xmldom 更新は Marp MathJax 描画で確認しました。

残件・制約

  • この検証環境の npm 11.9 では、最終コミットを GitHub / tarball から別プロジェクトへインストールした場合、同梱 shrinkwrap の修正版解決が適用されず、上流の固定依存 sharp / xmldom の旧版が再導入されました。audit 0 件はリポジトリの npm ci 環境に限定されます。固定依存を使用するには、チェックアウトして npm ci 後に node bin/mdv.mjs /path/to/documents で起動してください。上流の固定依存解消は残件です。
  • Windows / macOS の OS アプリ起動は実機未検証です。
  • HTML 保存では CORS で読み取れない Canvas、closed Shadow DOM、属性に未反映のフォーム状態を完全には保持できません。
  • C2PA native が導入できない場合は暗号署名検証を行えません。閲覧とバイト走査による検出は継続します。

未知の不具合が存在しないことを保証するものではなく、今回確認できた不具合を修正し、再発検知用のテストを追加した PR です。

API例外、symlink境界、正規表現検索の停止、HTML撮影の隔離、非同期表示競合、データ破損と機密マスク漏れ、画像解析、テーマを修正。
回帰テスト、Node 20/22 CI、監査記録を追加し依存関係を更新。
JSONLの元ソース行・レコード内容まで検証し、非同期ログ描画を待機する。
TOC属性エスケープを直接コンポーネントで検証し、GitHub配布経路の依存解決制約を記録。
@simota
simota marked this pull request as ready for review September 13, 2026 19:42
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 13, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-13T19:49:58.822602Z a5ea384 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@simota
simota merged commit 4b80f90 into main Sep 13, 2026
2 checks passed
@simota
simota deleted the fix/comprehensive-audit-20260913 branch September 13, 2026 19:47

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: a5ea3840ea

ℹ️ 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 bin/mdv.mjs
});

for (const signal of ['SIGINT', 'SIGTERM']) {
process.on(signal, () => child.kill(signal));

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Preserve the forwarded signal in the wrapper's exit status

When the wrapper receives SIGINT or SIGTERM (for example, from Ctrl-C or a service manager), this handler suppresses Node's default signal termination and forwards the signal to the child. The child then exits with code === null, and the existing child.on('exit', (code) => process.exit(code ?? 0)) reports success, so scripts cannot distinguish an interrupted server from a clean shutdown. Re-raise the signal in the parent or map the child's exit signal to the conventional nonzero status.

Useful? React with 👍 / 👎.

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