Skip to content

Commit f4923b6

Browse files
committed
docs(security): add 2026-07-17 post-audit diff review
Diff review of the 185 files (~6990 insertions) merged since the 2026-07-10 review (base 9c36a27..HEAD d496596). No findings at any severity. Surfaces reviewed: - SARIF 2.1.0 output (check/fix): serializes to the output stream via json.Encoder — no attacker-controlled path, JSON-escaped fields. - apm-input-token placeholder: bounded RE2 regex, no ReDoS. - init --add pack write path: triple-defended (relative .mdsmith/ containment, symlinked-parent refusal, non-clobbering Lstat); paths come from built-in data, not documents. - schema/index churn: map->struct{} set refactors plus a byte-cap added to the index side-output read (hardening). §0 baseline holds: no editor, CI, npm, python, LSP, or merge-driver source changed, and no new exec/spawn sink appears in the diff. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012f7bzeMDNoWgv7wCHwmBhm
1 parent d496596 commit f4923b6

5 files changed

Lines changed: 94 additions & 11 deletions

File tree

SECURITY.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -64,15 +64,16 @@ header: |
6464
|------|--------|-------|
6565
row: "| {date} | [{title}]({filename}) | {scope} |"
6666
?>
67-
| Date | Review | Scope |
68-
| ---------- | ---------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
69-
| 2026-07-10 | [mdsmith post-audit diff review — 2026-07-10](docs/security/2026-07-10-post-audit-diff-review/report.md) | diff since the 2026-07-03 post-audit diff review — word-list file loading, the F001/F002 fixes, directive-engine workspace containment, CLI/engine parser, CI/supply chain |
70-
| 2026-07-03 | [mdsmith post-audit diff review — 2026-07-03](docs/security/2026-07-03-post-audit-diff-review/report.md) | diff since the 2026-06-19 full-repo audit — directive engine, CLI/engine core, LSP, VS Code extension, CI/supply chain |
71-
| 2026-06-19 | [mdsmith full-repo security audit — 2026-06-19](docs/security/2026-06-19-full-repo-audit/report.md) | full repo — all seven threat-model surfaces |
72-
| 2026-06-19 | [LSP server and VS Code extension security audit](docs/security/2026-06-19-lsp-vscode-audit/report.md) | LSP server and VS Code extension |
73-
| 2026-06-12 | [mdsmith security audit — 2026-06-12](docs/security/2026-06-12-full-repo-audit/report.md) | full repo — all seven threat-model surfaces |
74-
| 2026-06-12 | [Git integration and LSP server audit](docs/security/2026-06-12-git-lsp-audit/report.md) | Git integration and LSP server |
75-
| 2026-06-09 | [mdsmith security audit — 2026-06-09](docs/security/2026-06-09-full-repo-audit/report.md) | full repo — all surfaces |
76-
| 2026-05-12 | [Supply-Chain Hardening — mini-shai-hulud / TanStack Class](docs/security/2026-05-12-supply-chain-hardening/report.md) | npm, PyPI, VS Code Marketplace, and Open VSX publishing surface; GitHub Actions CI/CD; lockfile and lifecycle-script handling. |
77-
| 2026-04-05 | [Adversarial Markdown Input](docs/security/2026-04-05-adversarial-markdown/report.md) | Adversarial markdown input causing unintended side effects on the host machine |
67+
| Date | Review | Scope |
68+
| ---------- | ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
69+
| 2026-07-17 | [mdsmith post-audit diff review — 2026-07-17](docs/security/2026-07-17-post-audit-diff-review/report.md) | diff since the 2026-07-10 post-audit diff review — SARIF 2.1.0 output, apm-input-token placeholder, the init --add pack surface, the okf starter, and the perf/schema churn |
70+
| 2026-07-10 | [mdsmith post-audit diff review — 2026-07-10](docs/security/2026-07-10-post-audit-diff-review/report.md) | diff since the 2026-07-03 post-audit diff review — word-list file loading, the F001/F002 fixes, directive-engine workspace containment, CLI/engine parser, CI/supply chain |
71+
| 2026-07-03 | [mdsmith post-audit diff review — 2026-07-03](docs/security/2026-07-03-post-audit-diff-review/report.md) | diff since the 2026-06-19 full-repo audit — directive engine, CLI/engine core, LSP, VS Code extension, CI/supply chain |
72+
| 2026-06-19 | [mdsmith full-repo security audit — 2026-06-19](docs/security/2026-06-19-full-repo-audit/report.md) | full repo — all seven threat-model surfaces |
73+
| 2026-06-19 | [LSP server and VS Code extension security audit](docs/security/2026-06-19-lsp-vscode-audit/report.md) | LSP server and VS Code extension |
74+
| 2026-06-12 | [mdsmith security audit — 2026-06-12](docs/security/2026-06-12-full-repo-audit/report.md) | full repo — all seven threat-model surfaces |
75+
| 2026-06-12 | [Git integration and LSP server audit](docs/security/2026-06-12-git-lsp-audit/report.md) | Git integration and LSP server |
76+
| 2026-06-09 | [mdsmith security audit — 2026-06-09](docs/security/2026-06-09-full-repo-audit/report.md) | full repo — all surfaces |
77+
| 2026-05-12 | [Supply-Chain Hardening — mini-shai-hulud / TanStack Class](docs/security/2026-05-12-supply-chain-hardening/report.md) | npm, PyPI, VS Code Marketplace, and Open VSX publishing surface; GitHub Actions CI/CD; lockfile and lifecycle-script handling. |
78+
| 2026-04-05 | [Adversarial Markdown Input](docs/security/2026-04-05-adversarial-markdown/report.md) | Adversarial markdown input causing unintended side effects on the host machine |
7879
<?/catalog?>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"target": {
3+
"mode": "audit",
4+
"repo": "jeduden/mdsmith",
5+
"ref": "d496596",
6+
"scope": "diff since the 2026-07-10 post-audit diff review — SARIF 2.1.0 output, apm-input-token placeholder, the init --add pack surface, the okf starter, and the perf/schema churn"
7+
},
8+
"coverage": "Diff review of the 185 files (~6990 insertions) changed between the 2026-07-10 review base (9c36a270)\nand HEAD (d496596). Work maps to two feature surfaces plus perf/test churn.\n\n(1) SARIF 2.1.0 output for `mdsmith check -f sarif` and `mdsmith fix --dry-run -f sarif`\n(internal/output/sarif.go, cmd/mdsmith/{check,fix,main}.go): the formatter serializes diagnostics to the\nprocess output stream (stdout/stderr) via json.Encoder — no attacker-controlled file path, no shell/URI\ninjection, since JSON encoding escapes the file/message fields, which are the only document-derived data.\n\n(2) apm-input-token placeholder (internal/placeholders/placeholders.go): matched by a bounded RE2 regex\n`\\$\\{input:[A-Za-z][\\w-]{0,63}\\}` — linear-time, no ReDoS.\n\nNew file-write surface — `mdsmith init --add <pack>` (internal/pack/*, cmd/mdsmith/main.go writeScaffolds):\npack file paths come from built-in convention data, not documents, and the write boundary is triple-defended.\nvalidatePackPath confines each path to a relative `.mdsmith/` first component after filepath.Clean;\nrefuseSymlinkedParents Lstat-rejects any symlinked parent component; statTarget Lstat-rejects a symlinked or\nexisting target and never clobbers. The okf starter reads embedded templates via embed.FS (fs.ValidPath\nrejects `..`; the name is a user CLI arg, not document content).\n\nNew MDS071 requiredfrontmatter rule and requiredstructure/fieldpatterncache.go: the only new dynamic regex is\nbuilt from regexp.QuoteMeta'd literals joined with `.+`, so MustCompile cannot panic and matching stays\nlinear; MDS071 re-reads only the file under lint via its own fs.FS. The schema/index/validate churn is\nmap[K]bool->map[K]struct{} set refactors plus routing the index side-output read through\nbytelimit.ReadFileLimited — a cap where the previous read was uncapped (hardening).\n\n§0 baseline reconfirmed by exclusion: no editors/, .github/ workflow, npm/, python/, LSP, merge-driver, or\npre-merge-commit source changed this window; the one build-surface change (MDS040 internal/rules/build/rule.go)\nis a map->struct{} refactor that leaves the rule advisory-only and the reserved-device-name path check\nunchanged. No new exec.Command/child_process/spawn sink appears anywhere in the diff. No Critical/High/Medium/\nLow/Info findings.\n\nNot re-reviewed (unchanged this window): the LSP server, VS Code extension, Obsidian plugin, Git integration,\nand CI/distribution wrappers — last covered by the 2026-06-19 and 2026-07-03 reviews.",
9+
"findings": []
10+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"$schema": "https://json.schemastore.org/sarif-2.1.0.json",
3+
"version": "2.1.0",
4+
"runs": [
5+
{
6+
"tool": {
7+
"driver": {
8+
"name": "mdsmith-security-review",
9+
"informationUri": "https://github.com/jeduden/mdsmith",
10+
"rules": []
11+
}
12+
},
13+
"results": []
14+
}
15+
]
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
[]
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
---
2+
date: "2026-07-17"
3+
scope: "diff since the 2026-07-10 post-audit diff review — SARIF 2.1.0 output, apm-input-token placeholder, the init --add pack surface, the okf starter, and the perf/schema churn"
4+
method: "audit"
5+
title: "mdsmith post-audit diff review — 2026-07-17"
6+
summary: "Diff review of the 185 files (~6990 insertions) merged since the 2026-07-10 review. No findings at any severity. The two feature surfaces — SARIF 2.1.0 output for check/fix and the apm-input-token placeholder — add no new sink: SARIF serializes to the output stream (no attacker-controlled path, JSON-escaped fields) and the placeholder uses a bounded RE2 regex (no ReDoS). The new init --add pack write path is triple-defended (relative .mdsmith/ containment, symlinked-parent refusal, non-clobbering Lstat) and its paths come from built-in data, not documents. Schema churn is map-to-struct{} set refactors plus a byte-cap added to the index side-output read (hardening). §0 baseline holds: no editor, CI, npm, python, LSP, or merge-driver source changed, and no new exec/spawn sink appears anywhere in the diff."
7+
---
8+
# mdsmith Security Review
9+
10+
- **Target:** jeduden/mdsmith @ `d496596`
11+
- **Mode:** audit
12+
- **Scope:** diff since the 2026-07-10 post-audit diff review — SARIF 2.1.0 output, apm-input-token placeholder, the init --add pack surface, the okf starter, and the perf/schema churn
13+
- **Date:** 2026-07-17
14+
15+
## Summary
16+
17+
Critical: 0 | High: 0 | Medium: 0 | Low: 0 | Info: 0
18+
19+
| ID | Sev | Conf | Title | Surface | Location |
20+
| --- | --- | ---- | ----- | ------- | -------- |
21+
22+
## Coverage
23+
24+
Diff review of the 185 files (~6990 insertions) changed between the 2026-07-10 review base (9c36a270)
25+
and HEAD (d496596). Work maps to two feature surfaces plus perf/test churn.
26+
27+
(1) SARIF 2.1.0 output for `mdsmith check -f sarif` and `mdsmith fix --dry-run -f sarif`
28+
(internal/output/sarif.go, cmd/mdsmith/{check,fix,main}.go): the formatter serializes diagnostics to the
29+
process output stream (stdout/stderr) via json.Encoder — no attacker-controlled file path, no shell/URI
30+
injection, since JSON encoding escapes the file/message fields, which are the only document-derived data.
31+
32+
(2) apm-input-token placeholder (internal/placeholders/placeholders.go): matched by a bounded RE2 regex
33+
`\$\{input:[A-Za-z][\w-]{0,63}\}` — linear-time, no ReDoS.
34+
35+
New file-write surface — `mdsmith init --add <pack>` (internal/pack/*, cmd/mdsmith/main.go writeScaffolds):
36+
pack file paths come from built-in convention data, not documents, and the write boundary is triple-defended.
37+
validatePackPath confines each path to a relative `.mdsmith/` first component after filepath.Clean;
38+
refuseSymlinkedParents Lstat-rejects any symlinked parent component; statTarget Lstat-rejects a symlinked or
39+
existing target and never clobbers. The okf starter reads embedded templates via embed.FS (fs.ValidPath
40+
rejects `..`; the name is a user CLI arg, not document content).
41+
42+
New MDS071 requiredfrontmatter rule and requiredstructure/fieldpatterncache.go: the only new dynamic regex is
43+
built from regexp.QuoteMeta'd literals joined with `.+`, so MustCompile cannot panic and matching stays
44+
linear; MDS071 re-reads only the file under lint via its own fs.FS. The schema/index/validate churn is
45+
map[K]bool->map[K]struct{} set refactors plus routing the index side-output read through
46+
bytelimit.ReadFileLimited — a cap where the previous read was uncapped (hardening).
47+
48+
§0 baseline reconfirmed by exclusion: no editors/, .github/ workflow, npm/, python/, LSP, merge-driver, or
49+
pre-merge-commit source changed this window; the one build-surface change (MDS040 internal/rules/build/rule.go)
50+
is a map->struct{} refactor that leaves the rule advisory-only and the reserved-device-name path check
51+
unchanged. No new exec.Command/child_process/spawn sink appears anywhere in the diff. No Critical/High/Medium/
52+
Low/Info findings.
53+
54+
Not re-reviewed (unchanged this window): the LSP server, VS Code extension, Obsidian plugin, Git integration,
55+
and CI/distribution wrappers — last covered by the 2026-06-19 and 2026-07-03 reviews.

0 commit comments

Comments
 (0)