credential: address the four remaining findings from the PR #127 review#138
credential: address the four remaining findings from the PR #127 review#138congwang-mk wants to merge 2 commits into
Conversation
…ny, match decoded query params Signed-off-by: Cong Wang <cwang@multikernel.io>
a50eaf0 to
6ede13b
Compare
|
@dzerik Please take a look. Thanks! |
|
Reviewed the four follow-ups against the code and traced enforcement on both the notif and chroot paths. Three are solid and complete:
One residual on the fs-deny suppression (fix 3), chroot-only. For non-chroot grants it's correct — Suggest: when |
…sion Signed-off-by: Cong Wang <cwang@multikernel.io>
Follow-up to #127, addressing the four findings that remained after the re-review:
Seekable stdin rejected for
fd:0. Stdin survives into the child (unlike fds above 2, which are closed post-fork), and a dup shares the file offset, so a< secret.txtredirect would let the child lseek back and re-read the secret even after the supervisor drained it.load_secretnow refuses a rewindable fd 0 and points at the pipe pattern; pipes/sockets/ttys (ESPIPE) stay allowed, and seekable sources on fds above 2 are unaffected.Header names validated at rule-parse time. A malformed
header:<name>/apikey:<name>previously surfaced only as a per-request 502 the first time the rule fired;parse_authnow runsHeaderName::from_bytesso a typo fails the build like every other spec error.File-overlap warning honors
fs-deny. The warning suggested "add an fs-deny for it" but did not consultfs_denied, so following the advice still warned on every run. The overlap check (extracted into a testableexposing_granthelper) now suppresses the warning when a deny covers the secret file.Query param names compared percent-decoded. A child spelling the target param with stray percent-encoding (
%6Bey=forkey=) evaded the Replace de-dup filter, leaving its pair alongside the injected one. Param names are now decoded before comparison, for both the Replace filter and the AddOnly presence check.Each fix comes with unit tests, including a stdin-swap test that exercises both the file-redirect rejection and the pipe acceptance on the real fd 0.
🤖 Generated with Claude Code