Hardening: base64 in SIMPLE_SAFE auto-approves decode, weakening the gate
Hi — first, thanks for Dippy. The independent per-stage pipeline analysis and the deny-with-advice UX are genuinely nice, and the SIMPLE_SAFE design is easy to read and reason about. This is a defense-in-depth suggestion, not a bug report about something currently exploitable on its own.
Observation. base64 is in SIMPLE_SAFE
(src/dippy/core/allowlists.py:121), and that set is documented as "always
safe regardless of arguments." In analyzer.py a SIMPLE_SAFE base returns
allow without inspecting arguments (line ~461), and pipeline stages are
analyzed independently (lines ~75–84). So base64 -d <<< <payload> is
approved on its own merits; in base64 -d <<< <payload> | bash only the
bash stage is doing the blocking.
Why it matters for a gatekeeper specifically. base64 -d is an
obfuscation primitive. Auto-approving it shifts the entire safety burden onto
sink detection: any execution path that isn't independently denied (a decode
redirected to a file that's later sourced, or a decoded blob handed to an
interpreter in a form the handlers don't catch) slips through, and the
decoded intent is also hidden from a human skimming the approval. For a tool
whose whole job is to be the boundary, having an always-allow obfuscation
primitive felt worth flagging.
Scope note. I want to be precise: the base64 entry in
src/dippy/cli/python.py (the pure-computation python -c module allowlist,
no file I/O) looks fine and is not what I'm raising — this is only about
the shell SIMPLE_SAFE entry.
Suggested fix. Keep encoding/checksums instant, but stop treating the
decode direction as unconditionally safe — drop base64 from SIMPLE_SAFE
and add a tiny handler that allows encode and asks on -d/-D/--decode.
That keeps base64 <file> and all the hashing tools zero-friction while
putting a human in the loop on decode. I'm happy to send a small PR with that
handler plus tests if it's useful — just let me know whether you'd prefer the
handler approach or a narrower analyzer special-case.
Thanks again for the project.