phasegate 0.114.0 → 0.116.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [0.116.0] - 2026-05-07
|
|
11
|
+
|
|
12
|
+
### Security
|
|
13
|
+
|
|
14
|
+
- **WI-036: skill-quality の git-commit-executor adapter におけるコマンドインジェクション (HIGH) を修正** — WI-035 Phase 3 横展開監査で発見した follow-up。`execSync(\`git commit -m ${JSON.stringify(message)}\`)` を `execFileSync('git', ['commit', '-m', message], ...)` 配列引数形式に置換。`JSON.stringify` がバッククオート / `$` をエスケープせず `/bin/sh -c` 経由で評価される経路を遮断。
|
|
15
|
+
- `scripts/harness/skill-quality/infrastructure/adapters/git-commit-executor-adapter.ts` を `execFileSync` 化、コンストラクタに `gitExecutor` を DI 可能化(テスタビリティ向上、`CommitExecutorPort.commit()` の外部 signature は不変)。
|
|
16
|
+
- 悪意ある `description`(バッククオート / `$()` / `;` / `"` / 改行 / `|` 含む)が引数配列にそのまま渡されシェル評価されないことを assert する unit test (`__tests__/unit/skill-quality/git-commit-executor-adapter.test.ts`) を新規追加。
|
|
17
|
+
- 横展開監査 (再走査): 非テストコード `scripts/harness/**/*.ts` の `execSync(\`...${var}...\`)` パターンが **完全消滅**(WI-035 / WI-036 で網羅完了)。
|
|
18
|
+
- WI-035 / WI-036 の `status` を `drafted` → `implemented` に更新。
|
|
19
|
+
|
|
20
|
+
## [0.115.0] - 2026-05-07
|
|
21
|
+
|
|
22
|
+
### Documentation
|
|
23
|
+
|
|
24
|
+
- **WI-036 起票** — WI-035 Phase 3 横展開監査の follow-up として、`scripts/harness/skill-quality/infrastructure/adapters/git-commit-executor-adapter.ts:14` の `execSync(\`git commit -m ${JSON.stringify(message)}\`)` を同種コマンドインジェクション (HIGH) の sink として切り出し、別 WI に分離。`JSON.stringify` がバッククオート / `$` をエスケープしないため、`description` が外部入力に由来すると `/bin/sh -c` 経由で評価され得る点を文書化。修正実装は次回(`execFileSync` 配列引数化 + DI seed 化 + 悪意 description fixture テスト)。
|
|
25
|
+
- WI-035 description.md の Phase 3 監査結果欄を「WI-036 として起票済み」に更新。
|
|
26
|
+
|
|
10
27
|
## [0.114.0] - 2026-05-07
|
|
11
28
|
|
|
12
29
|
### Security
|
package/package.json
CHANGED
package/scripts/harness/skill-quality/infrastructure/adapters/git-commit-executor-adapter.ts
CHANGED
|
@@ -2,16 +2,21 @@
|
|
|
2
2
|
* @layer infrastructure
|
|
3
3
|
* @unit skill-quality
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { execFileSync } from 'node:child_process';
|
|
6
6
|
import type { CommitExecutorPort } from '../../domain/ports/commit-executor-port.js';
|
|
7
7
|
import type { CommitMessage } from '../../domain/value-objects/commit-message.js';
|
|
8
8
|
import { SkillQualityError } from '../../domain/errors/skill-quality-error.js';
|
|
9
9
|
|
|
10
|
+
// WI-036: 配列引数で execFileSync を直接呼ぶことでシェル経由のメタ文字評価を遮断する。
|
|
11
|
+
type GitExecutor = (file: string, args: readonly string[], options: { stdio: 'pipe' }) => Buffer;
|
|
12
|
+
|
|
10
13
|
export class GitCommitExecutorAdapter implements CommitExecutorPort {
|
|
14
|
+
constructor(private readonly gitExecutor: GitExecutor = execFileSync) {}
|
|
15
|
+
|
|
11
16
|
async commit(commitMessage: CommitMessage): Promise<void> {
|
|
12
17
|
const message = commitMessage.format();
|
|
13
18
|
try {
|
|
14
|
-
|
|
19
|
+
this.gitExecutor('git', ['commit', '-m', message], { stdio: 'pipe' });
|
|
15
20
|
} catch (err) {
|
|
16
21
|
const rawMessage = err instanceof Error ? err.message : String(err);
|
|
17
22
|
// "nothing to commit" を検出して分かりやすいメッセージに変換
|