CVE backporting: when the fix isn't in your version
TL;DR
First verify the fix is actually missing from your version, not just undocumented. Then pick the cheapest safe path in order: upgrade to a fixed release, cherry-pick the upstream commit, take a vendor backport, or mitigate without the patch. Staying on an unfixed version with no mitigation is the one option that is never fine.
CVE backporting: when the fix isn't in your version
Use this when
- A CVE fix exists upstream but your pinned version predates it
- You maintain or depend on an LTS or stable branch that lags upstream
- A vendor advisory lists fixed versions and yours is not among them
- You are deciding whether a cherry-pick is safe or an upgrade is required
Not for this skill when
- The fix is already in your version (just upgrade to the patched release)
- There is no fix anywhere yet (that is the no-patch-available playbook)
- You are planning a general version upgrade with no CVE driving it
Steps
1. Verify the fix is really missing
Find the upstream fix commit and check whether your version contains it or an equivalent. Advisories sometimes understate backport coverage.
git log --oneline --grep="[fix-keyword]" [your-branch]
Expected: either the fix commit (or its backport) in your history, which ends the exercise, or its confirmed absence. Also check the vendor's security tracker; distro and vendor backports do not always appear in upstream git history.
2. Prefer upgrading to a fixed release
If a fixed release exists on your line, upgrade to it. It carries the maintainer's testing, not just yours.
Expected: the patched version installed and the reproduction from the advisory no longer triggering. This is the default answer; only move past it with a reason.
3. Cherry-pick when you cannot upgrade
If upgrading is blocked, cherry-pick the upstream fix commit onto your branch. Review the commit first: security fixes sometimes depend on earlier refactors that your branch lacks.
Expected: a clean cherry-pick with tests passing. If it conflicts heavily, that is signal: the fix does not apply cleanly to your version, and a partial backport can be worse than none.
4. Ask the vendor or distro for a backport
For commercial or distro-packaged software, the backport may already exist as a vendor patch even if upstream never cut a release on your line. Check their security portal before doing the work yourself.
Expected: a vendor patch or a clear statement of support status. If the version is end-of-life, the answer will be "upgrade," and you should treat that as a migration project, not a patch task.
5. Mitigate when no patch path exists
Block the vulnerable code path with configuration, network controls, or a wrapper until you can move versions. Document it as temporary with an owner and a date.
Expected: the reproduction blocked by the mitigation, verified by test. A mitigation is a bridge, not a destination; put the version move on the roadmap with a deadline.
Variant: backporting across a big version gap
The wider the gap, the more likely the fix depends on other changes. Budget real review time, run the upstream security tests if they exist, and prefer the upgrade path; heroics on ancient branches usually cost more than the migration.
Variant: vendored code with no upstream
When the code was copied, not depended on, there is no release to upgrade to. Port the fix by hand into the vendored copy and add a comment noting the source commit, so the next person knows where it came from.
Why this happens
Maintainers fix the current release line first and backport when they have capacity, which means older versions sit exposed for a while or forever. Pinning to an old version trades upgrade pain for exactly this situation, so the backport decision is the bill coming due on that trade.
Edge cases and pitfalls
- Partial backports: applying half a fix can change the bug's shape without closing it; verify with the actual reproduction.
- Fix dependencies: the security commit may rely on an earlier refactor; read the full commit, not just the diff hunk.
- Silent backports: vendors sometimes patch without a new version number; verify by testing, not by reading changelogs alone.
- EOL versions: no backport is coming, plan the migration instead of hoping.
- Cherry-pick without tests: if the fix has no test coverage on your branch, add a regression test with the backport.
Provenance
Resolved from the public thread: https://vectle.com/posts/pstYNuwNEia8HKc4siUzdeJA