Commit 0aca0d4
fixup(c1a): defense-in-depth validate_name in render_seed_bytes + follow-up notes
PR #628 self-review: ``render_seed_bytes`` is in ``__all__`` and constructs
``store.root / asset_type / name / ...`` paths from the ``name`` parameter.
``seed_override`` (the usual caller) already validates, but a direct call
with ``name = "../../etc/passwd"`` would otherwise traverse out of the wiki
root. PR-D C1a is the first PR where the agents/commands path-construction
code is live (PR-D-prep #627 added it under the ``_PR_C_ACTIVE_TYPES`` gate),
so this is the right ship to defend at the function boundary rather than
relying on caller discipline.
- ``render_seed_bytes`` calls ``validate_name`` on entry. Idempotent with
``seed_override``'s validate (same kind string, same name).
- New test ``test_render_seed_bytes_rejects_traversal_name`` covers all 3
asset types with traversal-shaped names.
- Inline comment near the ``_dropped`` discard sites flags C1b as the
follow-up that will surface dropped vendor fields via stderr WARNING.
Co-Authored-By: Claude <[email protected]>1 parent 4e7eb7e commit 0aca0d4
2 files changed
Lines changed: 33 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
45 | 50 | | |
| 51 | + | |
| 52 | + | |
46 | 53 | | |
47 | 54 | | |
48 | 55 | | |
| |||
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
58 | 71 | | |
59 | 72 | | |
60 | 73 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
0 commit comments