How to Fix a CVE Vulnerability

To fix a CVE vulnerability, confirm that the affected component and version are actually present and reachable in your environment, assess risk using severity, exploitability, and exposure, then upgrade to a fixed version or apply the vendor's mitigation. Rebuild and redeploy affected artefacts, verify with a rescan or test, and record the fix so audits and future scans agree.

Step 1: identify what is affected

Read the CVE record and vendor advisory to learn the affected product, version ranges, and conditions. Use your software bill of materials, dependency lock files, container image scans, and asset inventory to find where that component runs. Include transitive dependencies, which are often where vulnerable libraries hide.

Step 2: confirm exposure

Scanners match versions; they cannot always tell whether the vulnerable code path is used or reachable. Check whether the affected feature is enabled, whether the service is internet-facing, and whether attackers could reach the vulnerable function. Document why a finding is or is not exploitable in your environment.

Step 3: assess and prioritise

Combine severity, such as the CVSS score, with exploitation evidence, such as inclusion in CISA's Known Exploited Vulnerabilities catalogue or public exploit reports, and with your exposure. An actively exploited, internet-facing issue outranks a higher-scored bug in an isolated internal tool. Some teams also use exploit prediction scores.

Step 4: patch

Upgrade the affected component to a fixed version. For libraries, update the dependency and any parent dependencies that pin it. For operating system packages, apply vendor updates. For container images, rebuild from an updated base image. Prefer the smallest upgrade that includes the fix to reduce regression risk, then plan larger upgrades separately.

Step 5: mitigate when you cannot patch yet

If a fixed version is not available or cannot be deployed quickly, apply vendor mitigations: disable the vulnerable feature, restrict network access, add web application firewall rules, or change configuration. Record the mitigation, its owner, and a deadline to patch, because mitigations are easy to forget.

Step 6: test and deploy

Run tests to catch regressions from the upgrade. Deploy through your normal change process, with expedited paths for critical, actively exploited issues. Communicate with stakeholders if downtime or behaviour changes are expected.

Step 7: verify

Rescan the deployed artefact, not just the source repository, to confirm the vulnerable version is gone. Check every environment and every service that used the component. Stale images in registries and long-running instances are common places where old versions survive.

Step 8: record and close

Update the ticket with the fixed version, deployment date, verification evidence, and any accepted residual risk. Consistent records make audits easier and stop the same finding from being reopened by the next scan.

Handling false positives

Scanners sometimes flag components that are not present, backported fixes in distribution packages, or code paths that are unreachable. Document these with evidence and use your scanner's suppression or exception features, with expiry dates, so they are reviewed rather than ignored forever.

Speed matters

Exploitation of high-profile vulnerabilities can begin within hours or days of disclosure. Define response targets by risk level, rehearse the fast path, and keep dependency upgrades routine so emergency patches are not your first upgrade in years.

Using a software bill of materials

An SBOM lists the components inside each build. With SBOMs stored for every release, answering are we affected becomes a query rather than an investigation. Generate them in CI, store them alongside artefacts, and keep them current.

Communicating with stakeholders

For high-profile vulnerabilities, customers and leadership will ask whether you are affected before you finish investigating. Prepare a short status: affected or not, evidence, actions taken, and timeline. Update it as facts change, and avoid speculating.

Tracking vulnerability work as incidents

Critical, actively exploited vulnerabilities often deserve incident handling: an owner, a timeline, a communication cadence, and a record of actions. Treating them as ordinary backlog items slows response when speed matters most.

Container and image hygiene

Many CVEs live in base images rather than application code. Use minimal base images, rebuild images regularly even without code changes, pin image digests, and remove unused packages. Image scanning in CI catches vulnerable layers before deployment.

Policy and response targets

Write down how quickly each risk tier must be fixed, who can approve exceptions, and how long exceptions last. Clear, published targets turn vulnerability work from negotiation into routine.

Learning from each fix

After a significant vulnerability response, review how long each step took: discovery, confirmation, patching, deployment, and verification. The slowest step is where tooling or process investment will pay off most the next time.

Automating routine upgrades

Dependency update bots that open small, regular upgrade pull requests keep components current, so emergency fixes are minor version bumps rather than risky leaps.

Frequently asked questions

How do I fix a CVE in a dependency?
Upgrade the dependency to a version that includes the fix, including any parent packages that pin the vulnerable version. Regenerate lock files, rebuild artefacts, run tests, deploy, and rescan the deployed artefact to confirm the vulnerable version is gone from every environment.
What if there is no patch for a CVE?
Apply vendor-recommended mitigations, such as disabling the vulnerable feature, restricting network access, or adding filtering rules. Record the mitigation with an owner and review date, monitor for exploitation, and patch as soon as a fixed version is released. Track it like any open risk.
Should I fix every CVE my scanner reports?
Prioritise rather than treating all findings equally. Confirm the component is present and reachable, then rank by exploitation evidence, exposure, and severity. Document why lower-risk or unreachable findings are deferred, with review dates, so decisions are visible and revisited. Scanners count findings; risk is what matters.