Shift-Left Security: Catch CVEs Before They Catch You
CVEs in our code keep landing in front of us at the worst possible moment — after the build has already shipped. If your team has ever lost a sprint to an emergency dependency upgrade, this piece is for you.
CVEs in our code keep landing in front of us at the worst possible moment — after the build has already shipped.
If your team has ever lost a sprint to an emergency dependency upgrade, this piece is for you.
Our Recurring CVE-Fix Loop
The pattern is consistent:
- The PR scan tool flags vulnerable packages at PR open, but the warning is non-blocking — PRs merge anyway.
- Those unread warnings stack up over weeks and turn into background noise.
- Real attention only arrives when PSIRT raises a ticket, often long after the merge.
- By then, the fix has to be squeezed into a sprint that wasn't planned for it, under time pressure.
The gap isn't a missing tool — the PR scan tool is already in place. The gap is where and when the feedback shows up. By the time a CVE lands in a PSIRT report, the developer who introduced it has moved on to two or three other tasks, and reloading the context costs more than writing the original code did.
Why the Loop Keeps Spinning
Shifting security left sounds clean on a slide. In practice, teams hit real friction:
| Friction | What it looks like in the real world |
|---|---|
| Sprint velocity vs. security depth | Engineering performance is usually measured by PRs merged and features delivered. Security gates can feel like drag — especially when noisy or slow. Real shift-left needs metrics that reward prevention, not just throughput. |
| The threat landscape never sits still | New CVEs are published every day. Any process that depends on weekly scans or quarterly reviews is already behind by the time results land. |
| Tool fatigue | Stacking scanners without tuning them creates dashboards engineers learn to ignore. Volume of alerts is not the same as quality of signal. |
| Transitive dependencies | A team can be careful about every package they import directly and still ship a CVE that lives three levels deep in the dependency tree. |
| Cultural inertia | As long as security is treated as the security team's problem, it stays parked at the end of the pipeline. Real shift-left needs developers, security, and operations sharing the same definition of done. |
Naming these forces is the starting point. The rest of this piece is about pushing past them.
Breaking the Loop
Security that lasts doesn't pull against the way developers already work — it moves with them.
The strongest setups do more than catch vulnerabilities; they stop them from showing up in the first place. They teach in the moment, guide everyday decisions, and grow alongside the codebase and the team building it.
When that mindset takes hold, the loop breaks. Engineers stop treating security as a sprint-end checkbox and start catching issues while they're still typing. Vulnerabilities don't pile up because they don't make it past the developer's machine in the first place. Releases go out with fewer surprises, fewer fire drills, and a steadier sense of control.
What is Shift-Left Security?
Shift-left security is a shift in gravity — pulling security decisions earlier, closer to the code, closer to the people building it.
The traditional development cycle follows a familiar path:
Plan → Code → Build → Test → Deploy → Monitor
Security usually shows up late — after the build, often through periodic scans or external reports. By then, the code has moved on, the developer's context is gone, and any fix becomes a fire drill.
Shift-left flips that timeline. It pulls security checks into the earliest stages — planning and coding — so vulnerabilities surface while the developer is still in problem-solving mode, with full context on what they wrote and why.
But shift-left isn't about cramming more tools into the pipeline and calling it a day. It's about reshaping where and when security feedback shows up, so it fits the way developers actually work. When findings appear inline — in the editor, in the terminal, in the pull request — adoption goes up. Not because developers suddenly love security, but because it respects their flow.
From Plan to Prod
Shift-left works because it doesn't park security at a single checkpoint — it weaves it through every phase of how software gets built.
Planning — Security starts before any code is written. Bring it into sprint planning so risks shape the design, not the patch.
Coding — Most vulnerabilities can be stopped right here. Catch them while the developer still has full context on what they just wrote.
Building — Hook automated checks — static analysis, dependency scanning, vulnerability detection — directly into the build. Issues get surfaced before review, not after deploy.
Deploying — Lock down the CI/CD pipeline itself.
Running — Once code is live, the work isn't done. Continuous monitoring catches issues as they emerge in the runtime environment. Findings from production should flow back into earlier phases, so the next iteration ships safer than the last.
Catch It at the Keyboard
The earlier a CVE is caught, the cheaper it is to fix.
Best case: vulnerable code never gets committed. The catch happens locally, in seconds.
Here's what "good" looks like:
1. At the dev machine
A CVE scanner runs locally to catch vulnerable dependencies before push, IDE plugins flag risky functions or unsafe defaults as code is being written, and pre-commit Git hooks stop obvious problems before they leave the laptop.
2. At the PR
Pull request bots scan every change for known CVEs, and CI fails the build when one shows up in a code path the app actually uses.
No green check, no merge.
3. For dormant repos
Automation opens fix PRs the moment a new CVE is published — without waiting for someone to notice.
You can't afford to wait for a weekly scan or a quarterly review cycle to surface risk. By then the code has moved on, the developer has moved on, and the fix becomes a context-switch instead of a quick edit.
Key Takeaways
- Shift-left isn't more scans — it's earlier feedback. Catching a CVE in the editor takes minutes; catching it in a PSIRT report costs a sprint.
- Security belongs at every stage — planning, coding, building, deploying, and running — not just one checkpoint.
- Run a CVE scanner locally and in CI. A package that scans the codebase for known vulnerabilities — on the dev machine and again at PR time — catches issues before they leave the laptop.
- Automate updates for low-activity repos. Automated upgrade PRs keep dormant code from rotting.
- Make merge gates real. Warnings that don't block become noise; failing builds change behavior.
- Culture beats tooling. The goal is a team where checking for CVEs is as routine as running tests.
When security moves left, fire drills move out.
Fewer surprise CVEs. Fewer rushed fixes. Fewer disrupted sprints. And code that ships with quiet confidence.
If your team has wrestled with this loop — or broken out of it — I'd love to hear what worked. Drop a note in the comments.
Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.