Contents
Cover
What's Inside
01The Upgrade Trap
02Supply Chain Attacks
03The Missing Mechanism
04What Backporting Actually Is
05Detect → Patch → Validate
06Three Prompts, One Patch
07Getting Set Up
08Hands-On: CVE-2025-68675
09Go Deeper
10Root: Backporting at Scale
Appendix: Using the Repo
Get Started

Vibe Coding
a Backport

Anyone Can Patch: Backporting CVEs with AI
An interactive workshop from Root
Overview

What's Inside

This interactive workshop distills 3.5 years of work at Root into a hands-on walkthrough: how to backport a CVE fix using AI-assisted workflows — no version upgrade required. Follow along at your own pace, or clone github.com/Root-IO-Labs/anyone-can-patch and run the Anyone Can Patch materials in examples/ using the filled prompts and skills described under WORKSHOP-DEMO-GUIDE.md.

01
The Problem

The Upgrade Trap

Why "just upgrade" is broken and always was

03
The Solution

The Missing Mechanism

Pinned versions, backporting, and why it matters

06
The Workflow

Three Prompts, One Patch

Research, apply, and validate with AI

07
Setup

Getting Set Up

Prerequisites and quick start

08
Hands-On

CVE-2025-68675

Your first backport, step by step

10
The Product

Root: At Scale

Automating everything you just learned

</>
Appendix

Using the Repo

Clone it, run it, patch your own CVEs

01

The Upgrade Trap

The traditional security model is simple: detect vulnerabilities with scanners, upgrade to newer versions, re-scan, repeat. It's the Detect → Upgrade → Fix loop. And for a while, it kind of worked.

But every upgrade carries cost. Move from one major version to the next and you inherit breaking changes, dependency cascades, and regression risk.

Breaking Changes

Every upgrade introduces incompatible API changes that ripple through dependent services and codebases.

Dependency Cascades

One forced upgrade triggers a cascade of downstream changes across the entire dependency graph.

Regression Risk

New code ships new bugs. Every upgrade trades a known CVE for unknown regression risk.

Time to Exploit

Attackers weaponize CVEs in hours. The upgrade cycle takes weeks. The math doesn't work.

95%+
Code is third-party
40+
Vendors per stack
<1d
Time to exploit
02

Supply Chain Attacks Are Industrializing

The threat model has changed. Attackers don't target your application directly anymore — they target the packages your application depends on. One compromised package means millions of downstream victims.

John Amaral — CTO, Root
The threat has shifted
Attackers target packages, not applications directly
Supply chain attacks are now automated at scale
When the upgrade is the attack, upgrading makes it worse

You can't upgrade your way to safety when the upgrade itself is the attack vector. The industry needs a different model.

03

The Missing Mechanism

Pinning your package versions gives you reproducible builds and a clear control point. But CVEs still accumulate against pinned versions. Maintainers generally don't patch old versions — they want you on the newest thing.

John Amaral — CTO, Root

That's what backporting gives you. Take only the security fix from a newer version and apply it to the version you're actually running. Security benefit. Zero version bump. Debian, Red Hat, and Ubuntu have shipped backported patches for decades. Now it applies to npm, PyPI, and application-level packages too.

THE OLD WAY
1
Scanner flags CVE in your pinned dep
Day 1
2
Upgrade package to fixed version
Day 2
3
Tests fail — breaking API changes
Day 5
4
Fix tests, update downstream deps
Day 12
5
Re-scan — upgrade introduced 2 new CVEs
Day 18
Start over.
Day ??
1
Detect the CVE
Instant
2
Backport the security fix
Minutes
3
Validate — all tests pass, version unchanged
Done
04

What Backporting Actually Is

The situation: a CVE is fixed in v2.0, but your environment is locked to v1.8. Backporting extracts only the security fix from v2.0 and applies it directly to your pinned v1.8. No version bump. No surprises.

Extract

The commit that closes a CVE is rarely just the security delta. It usually sits in the same stream of work as refactors, new features, API moves, and dependency updates. Your task is to pull out only what remediates the finding.

+ "proxy",
+ "proxies",
Recontextualize

Port that logic into your pinned version. Adapt function names, paths, and patterns.

v2.11.1v2.10.5
same path, same frozenset
Preserve

Keep existing behavior intact. Remove only the vulnerability. Minimal diff. No surprises.

58 passed, 0 failures
version unchanged

Why backporting is hard

In the wild, the remediation is almost never the whole story. Maintainers ship it alongside refactors, new capabilities, renamed symbols, moved modules, and dependency evolution—all legitimate for them, much of it incidental for you. Drawing a defensible line between “closes the vulnerability” and “everything else in the same diff” is judgment-heavy and easy to get wrong. A patch that compiles but does not actually remove the exposure can be worse than no patch.

John Amaral — CTO, Root
05

A New Model:
Detect → Patch → Validate

Notice that "upgrade" is gone. You are no longer forced to inherit every change the maintainer made just to get one security fix.

Detect

Identify the CVE in your pinned dependency. Know the version, the attack vector.

Patch

Backport the security fix directly into your pinned version. Minimal change. No upgrade.

Validate

Build, test, and verify. Confirm the vuln is closed and no regressions were introduced.

The key insight: Your environment stays on known, tested versions. Only the security-relevant code changes. The diff is small, auditable, and reviewable. Security and stability are no longer in conflict.
06

Three Prompts, One Patch

In the Anyone Can Patch repo, the facilitator guide states that participants paste prompts and @ skills; the agent runs git, edits, installs, and tests. Each phase uses one prompt file and one skill under anyone-can-patch/skills/, in order.

From examples/CVE-2025-68675-apache-airflow-2.10.5/WORKSHOP-DEMO-GUIDE.md: “Follow the Step-by-step section: modify the prompt file named in that step … before you copy its fenced block.” “@ anyone-can-patch/skills/research-cve.md (then patch-cve.md, then validate-cve.md).” “Copy the fenced block from the saved prompt file into the chat.”

Each prompt file labels the block to paste as Copy-paste this prompt: (see 1-Research-Prompt.md, 2-Apply-Fix-Prompt.md, 3-Validate-Prompt.md in the example folder). A short user message is enough, e.g. to use that prompt together with the attached skill to run that phase.

Prompt 1
Research
Prompt 2
Apply Fix
Prompt 3
Validate
Per Root README.md: Cursor / agents: read AGENTS.md at the repo root for “non-negotiable rules (two git checkouts for research, no API-only shortcuts for Phases 3–4).” The research prompt’s MANDATORY LOCAL CHECKOUTS (Phases 3–4) section requires directories named exactly fix-tree and target-tree under the example folder, matching AGENTS.md.

Prompt / skill map (same guide, table under that heading): Research → 1-Research-Prompt.md + research-cve.md; Apply fix → 2-Apply-Fix-Prompt.md + patch-cve.md; Validate → 3-Validate-Prompt.md + validate-cve.md. Attach paths under anyone-can-patch/skills/ when you @ files in Cursor.

07

Getting Set Up

Before you start backporting, make sure you have these tools ready. After you clone the repo, open it in Cursor and follow examples/CVE-2025-68675-apache-airflow-2.10.5/WORKSHOP-DEMO-GUIDE.md — the guide’s quick-start path matches Root README.md: “Clone this repo, open it in your editor, then follow an example’s WORKSHOP-DEMO-GUIDE.md” (for instance that Airflow example folder).

Required
Git
For cloning the workshop repo and managing patch branches
Required
Cursor (or AI-enabled editor)
The prompts are designed for Cursor's agent mode. VS Code + Copilot also works.
For the demo CVE
Python 3.8+
Apache Airflow is a Python project. You'll need pip for the editable install and pytest.
For the demo CVE
~2 GB disk space
Two shallow clones of the Airflow repo (fix-tree + target-tree) plus dependencies.
Quick start
terminal
$ git clone https://github.com/Root-IO-Labs/anyone-can-patch.git
$ cd anyone-can-patch
# Open in Cursor; work from examples/CVE-2025-68675-apache-airflow-2.10.5/
# Read WORKSHOP-DEMO-GUIDE.md — skills live under anyone-can-patch/skills/
No security expertise needed. The filled prompts in the example folder and the skills under anyone-can-patch/skills/ encode CVE validation, upstream fix discovery, and test commands. The guide adds: “Do not treat cloning as something participants do manually first—the agent performs it when the research prompt/skill calls for local trees after the fix location is known.”
Hands-On Exercise

Your First Backport: CVE-2025-68675

Work inside examples/CVE-2025-68675-apache-airflow-2.10.5/ using the pre-filled 1-Research-Prompt.md, 2-Apply-Fix-Prompt.md, and 3-Validate-Prompt.md. For each phase, copy only the fenced block under Copy-paste this prompt:, attach the matching skill from anyone-can-patch/skills/, and add a minimal instruction in chat. Target CVE and scope:

Package
Apache Airflow (PyPI)
Vulnerable Version
2.10.5
Fixed In
2.11.1
Complexity
LOW — 1 file, 2 lines

CVE-2025-68675 is an information exposure issue: proxy and proxies fields on an Airflow Connection can leak credentials in logs. Here's how to fix it:

1
Research
1-Research-Prompt.md + anyone-can-patch/skills/research-cve.md. Save research.json next to the prompts (not under reference/), per the guide. Then read your JSON: the committed answer key includes "recommendation": "PROCEED" when backporting is advised (see reference/research.json). Confirm fix-tree/ and target-tree/ exist under the example folder; the prompt requires git rev-parse HEAD in each.
2
Apply fix
2-Apply-Fix-Prompt.md + anyone-can-patch/skills/patch-cve.md. Deliverables from the prompt: branch patch-CVE-2025-68675; edits under target-tree/airflow/utils/log/secrets_masker.py; unified diff saved as CVE-2025-68675-target-tree.patch beside the prompt files. Artifact checklist (same guide): CVE-2025-68675-target-tree.patch at example root matches git diff of those edits.
3
Validate
3-Validate-Prompt.md + anyone-can-patch/skills/validate-cve.md. The validate prompt lists pip install -e . and focused pytest tests/utils/log/test_secrets_masker.py. Compare your validation.json to reference/validation.json: that file records "passed": 58, "xfailed": 1, "verdict": "APPROVED"; regression_tests.notes states the xfail is pre-existing (see that file).
+
Explain (optional step)
The guide’s workflow is research → apply fix → explain → validate. Step 4 is PATCH.md next to the prompts; reference/PATCH.md is the committed example.
airflow/utils/log/secrets_masker.py
DEFAULT_SENSITIVE_FIELDS = frozenset({
"password", "secret", "private_key",
+ "proxy",
+ "proxies",
"token", "keyfile_dict", ...
})
That's the entire patch. Two strings added to a frozenset. Same version, same behavior — proxy credentials are now masked in logs. Matches upstream PR #61906.
09

Go Deeper

You’ve walked through one CVE. For the next one, the repo’s README.md describes examples/ as holding CVE-specific filled prompts plus reference/ with completed research.json, patch, PATCH.md, and validation.json for comparison. It also says to treat anyone-can-patch/ (generic prompts/ and skills/) as read-only when running a workshop and to copy into per-CVE example folders as needed.

Bootstrap a new CVE (from WORKSHOP-DEMO-GUIDE.md)
1.Goal: One folder per CVE/package/version.” Create examples/<CVE-folder>/; copy 1-Research-Prompt.md, 2-Apply-Fix-Prompt.md, 3-Validate-Prompt.md from anyone-can-patch/prompts/ if you are bootstrapping a new CVE.
2.Modify the prompt files (initial pass for a new CVE): Replace placeholders everywhere—including inside fenced prompts and json examples—so all three files stay consistent with each other and with the folder name.”
3.Run the same Cursor flow: fenced block + @anyone-can-patch/skills/research-cve.md (then patch-cve.md, validate-cve.md). Write outputs next to the prompts, not inside reference/ (README.md).
Canonical repo: github.com/Root-IO-Labs/anyone-can-patch. Only the Airflow example folder is shipped as a filled walkthrough; pick your own CVE and folder name when you extend the workshop.

You just learned how to backport one CVE.
Root does this thousands of times a day.

Everything in this guide — researching the upstream fix, assessing complexity, adapting the patch, validating it — Root does automatically. For every vulnerability. Across every version you run.

Step 1 — Scan

Connect your stack

Root inventories every dependency across npm, PyPI, Maven, Go, and 8+ ecosystems. Every version. Every transitive dep.

$ root scan --image myapp:latest
247 packages detected across 4 ecosystems
31 pinned versions with known CVEs
Appendix

Using the Repo

The workshop materials live at github.com/Root-IO-Labs/anyone-can-patch. Clone it, open it in Cursor, and follow the guide below.

README.md ← layout + quick start
AGENTS.md ← Cursor / agents (two checkouts, no API-only Phases 3–4)
anyone-can-patch/ ← reusable kit (README: treat read-only in workshops)
  prompts/
    1-Research-Prompt.md
    2-Apply-Fix-Prompt.md
    3-Validate-Prompt.md
  skills/
    research-cve.md
    patch-cve.md
    validate-cve.md
examples/
  CVE-2025-68675-apache-airflow-2.10.5/
    WORKSHOP-DEMO-GUIDE.md ← facilitator steps
    1-Research-Prompt.md ← filled for this CVE
    2-Apply-Fix-Prompt.md
    3-Validate-Prompt.md
    fix-tree/ ← gitignored; create per guide
    target-tree/ ← gitignored; create per guide
    reference/ ← completed run per reference/README.md

How to run a workshop (from README + guide)

1
Clone and openREADME.md: “Clone this repo, open it in your editor, then follow an example’s WORKSHOP-DEMO-GUIDE.md.”
2
Use the filled exampleWORKSHOP-DEMO-GUIDE.md: “This repo’s example folder is already filled for CVE-2025-68675; still re-check paths if your workspace root differs.” New CVEs: copy templates from anyone-can-patch/prompts/ and replace placeholders.
3
Paste + @ skill — copy the fenced block from the saved prompt; @ anyone-can-patch/skills/research-cve.md (then patch-cve.md, validate-cve.md), per the guide’s “How to use Cursor (prompts-only workflow)” section.
4
Save artifacts beside promptsREADME.md: your run’s outputs go next to the prompts, not inside reference/.
5
Agents read AGENTS.mdREADME.md: “Cursor / agents: read AGENTS.md at the repo root for non-negotiable rules (two git checkouts for research, no API-only shortcuts for Phases 3–4).”
From AGENTS.md: “For every per-CVE folder under examples/, the two clone directories must be named exactly fix-tree (upstream at the fixed ref) and target-tree (same remote at the vulnerable ref).” Those directories are gitignored; create them per WORKSHOP-DEMO-GUIDE.md (README.md layout).

You don't need to upgrade everything to be secure.

Apply the right fix in the right place. Root generates validated backported patches for your pinned versions — automatically.
Vibe Coding a Backport