Hand-rolled egress/gitconfig YAML emitters don't escape quotes/newlines #258
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: Low (robustness; no agent privilege boundary crossed)
egress_render_routes/_route_to_yaml_fields(bot_bottle/egress.py) interpolate manifest strings (host, path/header match values, auth_scheme) into"..."YAML scalars with no escaping of",\, or newline.git_gate_render_gitconfig(bot_bottle/git_gate.py:115) has the same shape forUpstream/ the ssh alias into gitconfig.This path is operator-manifest only — the agent-proposed routes path is parse-validated and written verbatim, never re-rendered through these emitters — so there is no privilege escalation. But a stray quote in an otherwise-legitimate header-match value silently corrupts
routes.yaml; the strict re-parse then fails and the sidecar falls back to empty/stale routes (a fail-closed but confusing outcome). A newline inUpstreamcould inject arbitrary gitconfig keys.Fix: escape
"/\/newline at render time, or assert-reject these metacharacters in the affected manifest fields with a clear error.Filed from a security audit of the TLS-interception egress path and git-gate credential handling (follow-up to the
prd-0054-install-scriptquality-eval review). The core controls — default-deny, per-bottle CA, sidecar credential isolation — were confirmed sound; these are residual hardening gaps.