Socket Patch FAQ
Do I need a Socket account?
No. Patches for critical CVEs are free and need no account or token: install socket-patch and run socket-patch scan. Patches for every other CVE need an API token for an organization with Socket Patches.
Does a patch change my dependency versions?
No. A patch backports the fix into the exact version you already use. The version in your manifest and lockfile stays the same.
What changes in my repository?
In hosted mode, the lockfile entry for each patched package changes: its link and its integrity hash. Some package managers also get one registry setting, which the CLI writes and reports. In vendored mode, the lockfile entry changes and a new .socket/vendor/ directory holds the patched packages. Run socket-patch scan --dry-run to see the exact files first.
Do I have to run anything after installing dependencies?
No, in hosted and vendored modes. Your package manager installs the patched package itself, so there is no install hook and no Socket tool on your build machines. Only agent mode, the older in-place mode, needs socket-patch apply after each install.
Do my builds depend on Socket being up?
In hosted mode, an install with a cold cache downloads patched packages from patch.socket.dev. In vendored mode the packages are in your repository, and installs need nothing from Socket. Run socket-patch vendor to switch.
What happens to my patches if I cancel?
They keep working. A hosted link doesn't expire and doesn't depend on your subscription, so a lockfile you committed keeps installing. You are also free to vendor patched packages into your repository and keep using them.
Are hosted patch links permanent?
A link doesn't expire. Socket stops serving one in two cases, so that installs fail instead of using a bad package: when the patch is withdrawn as unsafe or broken, and, for Cargo, RubyGems, NuGet, Maven and Go, when the patch is replaced or retired. Rerun socket-patch scan to move to the replacement. If you want no dependency on a link at all, vendor the patch.
Is the token in a patch link a secret?
No. It records who the link was issued to and unlocks only that one patch. It is meant to be committed with your lockfile.
How do I know a patch won't break my code?
Every patch is reviewed by an engineer and tested against the original package before it is published:
- Regression tests have to pass on both the original and the patched package.
- Differential tests compare the two side by side and require the same behavior everywhere except the vulnerability.
- Compatibility tests run on the runtime the release supports, and each patch is reviewed for breaking changes.
- A working exploit has to succeed against the original package and fail against the patch.
- Benchmarks compare run time and memory before and after.
What metrics does Socket publish for a patch?
Each patch's page on socket.dev has a Verification section that compares the package before and after the patch: exploits reproduced and blocked, tests passed, the change in run time and peak memory, and the size of the patch in lines, files and functions. The metrics behind each patch explains how each one is measured.
Which ecosystems are supported?
npm (npm, pnpm, Yarn, Bun and vlt), Python, Rust, Go, Ruby, .NET, PHP, Java and Kotlin (Maven and Gradle), Scala and Deno. The support matrix lists each package manager and mode.
How is this different from socket fix?
socket fix?socket fix upgrades a dependency to a version that has the fix. socket-patch keeps the version you have and patches it. Use socket fix when a clean upgrade exists, and a patch when it doesn't.
How is socket-patch different from socket patch in the Socket CLI?
socket-patch different from socket patch in the Socket CLI?socket patch runs an earlier release of the same tool, bundled with the Socket CLI. It has no hosted or vendored mode. Use the standalone socket-patch binary.
What if a package has more than one CVE?
One patch applies per package version. socket-patch scan applies the highest ranked patch and names the advisories that stay open. Upgrade the package to clear those.
What happens when I upgrade a patched package?
The new version installs from the registry as usual. A patch belongs to one exact version, so run socket-patch scan again to see whether the new version needs a patch of its own.
I already patch a package with patch-package or pnpm. Will this conflict?
patch-package or pnpm. Will this conflict?No. socket-patch scan skips packages you already patch with another tool and reports them. Pass --allow-patch-conflicts if you have reviewed the overlap and want both.
How do I undo a patch?
socket-patch rollback minimist puts one package back on the upstream release, and socket-patch rollback does it for every package. socket-patch vendor --revert undoes vendoring. Reinstall afterwards.
Can I use patches in an air-gapped build?
Yes, with vendored mode. Run socket-patch scan --mode vendored on a machine with network access and commit .socket/vendor/. Only the patched packages are vendored, so your other dependencies still need your usual mirror or cache.
How do I roll patches out gradually?
socket-patch scan --max-new-patches 5 adds at most five newly patched packages per run, most severe first. A socket.yml at the repository root can also limit patches by ecosystem, path, package or severity. See Roll patches out gradually.
How do I tell my vulnerability scanner that a CVE is patched?
Run socket-patch vex --output socket.vex.json and import the file with your scanner's VEX support. Socket's own CycloneDX, SPDX and OpenVEX exports also record applied patches. See Prove what you patched.
Why does Socket still show "Patch available" after I patched?
The Alerts page shows the default branch and updates on its next scan. Merge the lockfile change and let Socket scan it. Socket reads applied patches from npm, Python, Go, Rust and Ruby lockfiles; for other ecosystems, use socket-patch vex as the record.
What does socket-patch send to Socket?
socket-patch send to Socket?The names and versions of your dependencies, to look up patches, and usage telemetry about each command's outcome. It never sends source code. --no-telemetry turns the telemetry off.
Updated about 2 hours ago