diff options
| author | Ludovic Courtès <ludo@gnu.org> | 2026-06-08 23:50:14 +0200 |
|---|---|---|
| committer | Ludovic Courtès <ludo@gnu.org> | 2026-07-02 19:42:48 +0200 |
| commit | 5e0b68f3737ec29595bf92c8ce209702f5bd80be (patch) | |
| tree | 426050e74fe0635ebc6364c8dd09fe4b876287c5 /tests/challenge.scm | |
| parent | 26fe5af3e39405b19b8b52f6e3263cd9d1cb8653 (diff) | |
narinfo: Reject narinfos where store file names are invalid.
This change safeguards against narinfos that would advertise
“StorePath: /gnu/store/…-foo/../../../etc/passwd” or similar, which could
otherwise propagate down the line and lead to attempts to overwrite said file,
should ‘guix-daemon’ be running as root.
* guix/narinfo.scm (narinfo-maker): Validate ‘path’, ‘references’, and
‘deriver’ and return #f upon failure.
(read-narinfo, string->narinfo): Adjust docstring accordingly.
* guix/substitutes.scm (fetch-narinfos): Remove check for ‘narinfo-path’
prefix; instead check whether ‘read-narinfo’ returned true.
(cached-narinfo): Check whether ‘string->narinfo’ returned true.
* tests/substitute.scm ("query narinfo that contains invalid store path"): New
test.
Change-Id: I0be2ea88b7f762144fca35373363364df3264b5a
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests/challenge.scm')
0 files changed, 0 insertions, 0 deletions
