#4

security: default markdown upload sends screenshots to public 0x0.st

Openmochafreddoopened 7mo ago

Summary

before-and-after currently defaults to uploading screenshots to the public file host https://0x0.st when markdown output/upload flows are used.

That behavior is documented in the README and skill, implemented in the runtime upload code, and covered by tests.

For a tool that is often used against preview deployments, internal apps, or PR screenshots, this is a risky default because screenshots can contain non-public UI, internal URLs, user data, or other sensitive content.

Why this is a problem

This is not just a documentation issue:

  • README.md says images are uploaded to 0x0.st by default.
  • src/upload.ts sets https://0x0.st as the default upload target.
  • src/bin/cli.ts uploads on --markdown when no custom upload URL is supplied.
  • The bundled skill defaults to the 0x0st adapter.
  • Integration tests assert the default behavior.

So the current package behavior is effectively "public external upload by default".

Expected behavior

The default should be secure-by-default / fail-closed for sensitive screenshots. For example:

  • require an explicit --upload-url / UPLOAD_URL, or
  • require an explicit opt-in flag for public uploads, or
  • default to a user-owned/private storage backend instead of a public anonymous host

Actual behavior

A user can run:

before-and-after <before> <after> --markdown

and the tool will upload screenshots to 0x0.st unless a custom upload destination is configured.

Affected files

  • README.md
  • src/upload.ts
  • src/bin/cli.ts
  • skill/SKILL.md
  • skill/scripts/upload-and-copy.sh
  • skill/scripts/adapters/0x0st.sh
  • skill/scripts/adapters/gist.sh
  • tests/integration/upload.test.ts

Steps to reproduce

  1. Inspect src/upload.ts and note DEFAULT_UPLOAD_URL = 'https://0x0.st'.
  2. Inspect src/bin/cli.ts and note that --markdown triggers upload when no custom URL is supplied.
  3. Inspect README.md, which states that 0x0.st is the default.
  4. Inspect skill/scripts/upload-and-copy.sh, which defaults IMAGE_ADAPTER to 0x0st.
  5. Inspect skill/scripts/adapters/0x0st.sh, which POSTs the file to https://0x0.st and returns a public URL.

Suggested fix

One of these would materially improve the default:

  • remove 0x0.st as the implicit default and require an explicit upload destination
  • add an explicit --public-upload / --allow-public-upload opt-in for 0x0.st
  • make --markdown fail with a message unless a custom upload backend is configured
  • at minimum, add a loud runtime warning and avoid treating public upload as the default safe path

Context

The root AGENTS.md describes this project as generating PR-ready markdown tables with uploaded images, which makes secure defaults especially important for real-world use on preview/internal applications.

Observed on

  • Repository: vercel-labs/before-and-after
  • Branch: main
  • Observed: 2026-04-07

Activity

0

No activity yet.