Curl Pipe Guard

Shows where a curl | sh install script really comes from and offers download, inspect and verify steps instead, before an untrusted script runs.

StopsRan an untrusted install script

Installation

pnpm dlx shadcn@latest add https://bollard-ui.vercel.app/r/curl-pipe-guard.json

The files land in your project. They're yours to edit.

Usage

curl-pipe-guard-usage.tsx
import { CurlPipeGuard } from "@/components/ui/curl-pipe-guard"

<CurlPipeGuard
  key={pick}
  {...example}
  onCopy={(_, mode) => setLog(mode === "steps" ? "Copied the safer steps." : "Copied the one-liner.")}
  onRun={(_, mode) => new Promise<void>((resolve) => setTimeout(() => (setLog(`Ran the ${mode === "steps" ? "steps" : "one-liner"} in the terminal.`), resolve()), 700))}
/>

What it catches

  • Plain http:// and raw IP addresses
  • Link shorteners and hosts that aren't the product's own domain
  • sudo and -k/--insecure
  • No checksum and no -f (fail on HTTP errors)
  • A safer download, inspect, verify and run sequence to copy instead

Props

CurlPipeGuard props
PropTypeDefault
command* (required)

The install one-liner as the docs show it, e.g. `curl -fsSL https://bun.sh/install | bash`.

string—
mode

Controlled copy mode.

CurlPipeMode—
defaultMode

Initial mode when uncontrolled. Defaults to the safer steps whenever something is flagged.

CurlPipeMode—
onModeChange

Called when the user switches between the one-liner and the steps.

(mode: CurlPipeMode) => void—
onCopy

Called after a successful copy with exactly what was copied.

(text: string, mode: CurlPipeMode) => void—
onRun

Shows a Run button (for terminals and IDEs). May return a Promise; the button shows a pending state and ignores repeat clicks.

(text: string, mode: CurlPipeMode) => void | Promise<void>—
messages

Any visible string.

Partial<CurlPipeMessages>—

* required. Also accepts the native props of <div> (className, aria-*, data-*…), passed through to it.

Accessibility

  • Copy mode is a role="radiogroup" with roving tabIndex and arrow keys
  • HTTPS vs HTTP is shown with icons and text
  • Findings are written out in text

Only what the source does. Test with your own screen reader and content before shipping.

Limitations

  • Parses the command text; it cannot tell whether the script itself is safe
  • Command forms it can't parse are flagged as unparsed rather than analysed
  • A matching domain can still serve a compromised script

What it stops

Ran an untrusted install script

Also known as

curl | sh · curl bash · install script · one-liner · wget · powershell iex · terminal · copy command

Field type

Dependencies

Pairs well with