Skip to content

Commit efd2ae8

Browse files
committed
fix(coverage): reject dotted include lock paths
A current-directory prefix or doubled slash still named a candidate requirements lock after path-kind checks. Include targets must now equal their normalized relative POSIX form so ./ and // cannot enter the image.
1 parent d9a6de7 commit efd2ae8

4 files changed

Lines changed: 10 additions & 5 deletions

File tree

‎AGENTS.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
<!-- CWL-ENTRY -->
44
> **Agents: read the master context FIRST.** Before any work, read [`docs/CWL-MASTER-CONTEXT.md`](docs/CWL-MASTER-CONTEXT.md) (mission · naruon-as-platform + inter-component UML · cross-cutting disciplines · conventions · roadmap · current state), the live **GitHub Project #1** <https://github.com/orgs/ContextualWisdomLab/projects/1> (work/roadmap source of truth), the full spec **ContextualWisdomLab/naruon#974**, and operate the Project per [`docs/agent-github-project-protocol.md`](docs/agent-github-project-protocol.md). The repo/Project — not any private agent memory — is the source of truth.
5-
65
Materialize accepts only exact SHA-256 pins or a bounded relative `-r` include (no `.`/`..`); a lone `--require-hashes` directive is not trust evidence. See [`docs/doctoring/hourly-nvidia-nim-autofix.md`](docs/doctoring/hourly-nvidia-nim-autofix.md).
76
Conflict-scope roots fail closed when the immediate parent directory is a symbolic link.
87
OriginWeave hourly NVIDIA NIM repair is a thin caller at minute 10. See [`docs/doctoring/originweave-hourly-review-caller.md`](docs/doctoring/originweave-hourly-review-caller.md).
98
nonnest2 hourly NVIDIA NIM repair is a thin caller at minute 16. See [`docs/doctoring/nonnest2-hourly-review-caller.md`](docs/doctoring/nonnest2-hourly-review-caller.md).
9+
Trusted requirement includes must be normalized relative POSIX lock paths; `./` and `//` are rejected.

‎CHANGELOG.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Semantic Versioning where the repository publishes a release.
4949
- Bind reusable scheduler implementation to the validated called-workflow repository, SHA, ref, and file path, and verify the checked-out commit before executing privileged scheduler logic.
5050
- Removed the ambiguous central-repository schedule fallback that could scan `.github` instead of Clearfolio when no external variable was configured; the active product caller now names Clearfolio explicitly while the reusable engine retains caller and dispatch overrides.
5151
- Corrected the conflict-ordering regression contract to select the conflict-specific snapshot and verification after the ordinary path adopted the same trusted helper.
52-
- Hardened base-owned Python requirements materialization so candidate package lines require exact `==` pins with complete SHA-256 hashes and requirement includes use only bounded relative paths; range pins, malformed digests, pip option lines, URL/absolute/traversing/home/query/fragment/backslash/option-like includes, and include lines carrying extra inline options are rejected before the trusted build context.
52+
- Hardened base-owned Python requirements materialization so candidate package lines require exact `==` pins with complete SHA-256 hashes and requirement includes use only normalized relative candidate lock paths; `./` and doubled-slash targets, range pins, malformed digests, pip option lines, URL/absolute/traversing/home/query/fragment/backslash/option-like includes, and include lines carrying extra inline options are rejected before the trusted build context.
5353

5454
### Security
5555

‎docs/doctoring/trusted-requirements-directory-lock-discovery.md‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,11 @@ preflight rather than relying on file names or hash-looking text alone.
6767
ineligible.
6868
- Exact `==` package pins with complete SHA-256 hashes are accepted; `>=` and
6969
malformed/truncated hash forms are rejected.
70-
- Bounded relative includes such as `--requirement other.txt` and
71-
`-r ./locks/other.txt` are accepted; URL, absolute, traversal, home-expansion,
72-
query/fragment, backslash, and option-like forms are rejected.
70+
- Bounded relative includes such as `--requirement requirements-other.txt` and
71+
`-r requirements/other.txt` are accepted. Current-directory prefixes
72+
(`./requirements/other.txt`), empty path components (`requirements//other.txt`),
73+
URL, absolute, traversal, home-expansion, query/fragment, backslash, and
74+
option-like forms are rejected.
7375
- A global `--require-hashes` directive combined with an unpinned requirement is
7476
rejected rather than promoted into the networked coverage image.
7577
- Only qualifying base-owned candidates are emitted from realistic temporary Git

‎tests/test_requirements_directory_lock_materialization.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ def test_materializes_hash_pinned_requirements_directory_lock(
8888
(b"-r requirements/other.txt\n", True),
8989
(b"--requirement other.txt\n", False),
9090
(b"-r ./locks/other.txt\n", False),
91+
(b"-r ./requirements/other.txt\n", False),
92+
(b"-r requirements/./other.txt\n", False),
93+
(b"-r requirements//other.txt\n", False),
9194
),
9295
)
9396
def test_global_hash_directive_does_not_replace_per_requirement_trust(

0 commit comments

Comments
 (0)