Nguyen Le Phong

Shift-Left Security Starts With Better Questions

Shift-left security means asking the risky questions while code is still cheap to change: four threat-model questions, safe defaults, review checks and tools people read.

Two days before release, someone on the team pokes at the new invoices page and changes the number at the end of the URL from 1042 to 1043. Up comes another customer's invoice. The feature passed QA, the demo is recorded, and half the team is already thinking about next sprint. The fix is three lines: check that the invoice belongs to the logged-in account. The conversation afterwards takes a lot longer. Why are we only finding this now?

That bug has a name. OWASP calls it broken access control, and it holds the #1 spot in the OWASP Top 10:2025. In the data behind that list, 100% of the applications tested had some form of it (A01:2025 Broken Access Control). So if it happens on your team, you're in very large company. It's also exactly the kind of bug that's cheap to stop early and painful to find late.

Five engineers sit around a table with laptops and a printed release checklist while a screen on the wall shows a red warning in a system diagram.
A security finding hurts most after the release plan has set. The fix is usually possible. The real question is why the risk had to get expensive first.

What shifting left actually means

Lay your delivery flow out as a line: idea, design, code, review, test, release, production. Shifting left means moving security thinking toward the left end, closer to design and code, so it stops being a single inspection right before release. NIST's Secure Software Development Framework is blunt about why: few development lifecycles cover security in depth, so secure practices "usually need to be added to each SDLC model" (NIST SP 800-218). The aims it lists include helping teams "reduce the number of vulnerabilities in released software" and "address the root causes of vulnerabilities to prevent future recurrences."

The phrase gets misread in a few ways, so a quick clarification. Shift-left doesn't turn every developer into a full-time security specialist. It isn't ten scanners shouting on every pull request until everyone mutes them. And it doesn't swap expert review for optimism. The useful version gives engineers practical guardrails early and saves expert attention for the decisions where judgment really matters.

Start with four questions

Threat modeling sounds like a two-day workshop with a whiteboard full of boxes. It can take ten minutes. Adam Shostack, author of Threat Modeling: Designing for Security, boils the practice down to four questions (Shostack's Four Question Frame):

  1. What are we working on?
  2. What can go wrong?
  3. What are we going to do about it?
  4. Did we do a good job?

Ask them at design time and the second question usually does most of the work. For a typical web feature, "what can go wrong" breaks down into questions anyone on the team can ask:

  • What data comes into this feature, and who's allowed to see it?
  • What happens if a user changes this ID, this role or this price in the request?
  • Can this action be undone? If not, who should be allowed to trigger it?
  • Are we logging anything sensitive, like tokens, passwords or personal data?
  • What dependency are we adding, and who maintains it?
  • Where do the secrets for this live?
  • What would a bored, curious user try first?

None of these are dramatic. They're small enough to ask before the code gets big, and the invoice bug from the opening dies at question two.

An engineer sketches a flow diagram with user icons and a lock on a whiteboard while four teammates around the table follow along.
Threat modeling doesn't need ceremony. A short talk at the right moment can expose a trust boundary that would otherwise stay hidden until release week.

Make the safe path the easy path

Questions help, but people forget things under deadline pressure. The stronger move is to build defaults so the secure choice happens without anyone remembering a rule. Google's Safe Coding work is a well-documented example. As Christoph Kern describes it, the core principle is to "shift responsibility for safety from individual developers to the programming language, software libraries, and frameworks," and at Google that approach has "nearly eliminated vulnerabilities such as Cross-Site Scripting (XSS) and SQL injection" (Christoph Kern, Google Research).

You don't need Google's scale to borrow the idea. In a normal product team it looks like this:

  • An authorization helper every endpoint uses, so "does this record belong to this user?" is one line instead of something each developer reinvents.
  • Deny by default. OWASP's first prevention point for broken access control is "Except for public resources, deny by default."
  • Input validation and query builders that make the injection-prone way awkward to write.
  • A logging wrapper that redacts tokens and personal data on its own.
  • Secret scanning before code leaves the laptop. GitHub's push protection, for example, "blocks pushes that contain secrets before they reach your repository" (About push protection).
  • Project templates that ship with all of the above already wired in.

At BonBon, where I'm a part-time co-founder, we made a call like this for our Mini App inside the VETC app: sessions live only in memory, and no tokens go into browser storage. That's one less rule anyone has to remember on a busy day.

An engineer points at a monitor showing an architecture diagram with a shield icon while a teammate beside him types on a laptop.
Guardrails matter because secure habits have to survive an ordinary week of deadlines. The safe path wins when it's also the shortest one.

Add a security lens to code review

Pull requests are a natural checkpoint. Formatting belongs to the linter. A reviewer's time is better spent on trust boundaries:

  • Does the server check ownership, or does it trust whatever ID the client sends?
  • Does the API return more fields than the UI needs?
  • Do error messages leak stack traces, SQL or internal hostnames?
  • Is there a test that a user without permission gets a 403 (or a 404)?
  • Do we really need this new dependency?

OWASP's list of common broken-access-control flaws reads like a review checklist. Two entries are "permitting viewing or editing someone else's account by providing its unique identifier" and "an accessible API with missing access controls for POST, PUT, and DELETE." If a PR touches an endpoint, each of those deserves thirty seconds. When you do find one, mark it as blocking and explain the fix, the way kind code review suggests.

Tools people actually read

Static analysis, dependency alerts, container scans and secret scanners all help, as long as someone reads and tunes what they produce. If every scan dumps a noisy list nobody owns, people learn to scroll past it, and the real finding drowns with the rest.

Give every finding a short path to a decision:

DecisionWhenWhat to write down
Fix nowReal risk, reachable in our codeLink to the fix PR
Accept for nowReal but low impact, or no fix available yetReason, owner and a date to look again
SuppressFalse positiveWhy it's false, so the next person doesn't re-check it
EscalateBigger than one PR (a design flaw, a shared library)Who owns the follow-up

Start with a small rule set and turn on more once the team trusts the signal. A scanner with five findings people fix beats one with five hundred they ignore.

Keep the experts close to the risky parts

Shifting left changes when security people show up. It doesn't send them away. If developers only meet security as late criticism, they'll treat it as an obstacle. If security folks help build the reusable patterns, explain risks in plain words and prioritize by real impact, the relationship changes, and security starts to feel like part of quality.

Some changes still deserve a dedicated expert pass: authentication, payments, anything holding personal data, anything a partner trusts you with. At BonBon, our Mini App went through VETC's OWASP security review, an independent pentest and their change approval. Guardrails catch the common mistakes. Experts look at what guardrails can't see.

Try this week

  • At your next design chat, spend ten minutes on the four questions.
  • Pick one endpoint and call it with someone else's ID.
  • Turn on secret scanning or push protection for one repo.
  • Write down the triage path for scanner findings: fix, accept, suppress or escalate.
  • Add "does the server check ownership?" to your PR template.
What did you think?

Frequently asked questions

What is shift-left security?
It means moving security thinking earlier in delivery, into design, coding and review, instead of relying on one inspection right before release. NIST's Secure Software Development Framework makes the same case: secure practices usually have to be added to whatever development lifecycle a team already uses.
Does shift-left mean developers do the security team's job?
No. Developers get practical guardrails and a few good questions, and security experts spend their time on high-risk work like authentication, payments and personal data. Experts also help by building reusable secure patterns the whole team can use.
What is the quickest way to start threat modeling?
Use Adam Shostack's four questions at design time: What are we working on? What can go wrong? What are we going to do about it? Did we do a good job? Ten minutes at the start of a feature is often enough to catch an access-control gap.
Which security issue should code reviewers check first?
Access control. Broken access control is #1 in the OWASP Top 10:2025, and OWASP found some form of it in 100% of the applications tested. Check that the server verifies ownership instead of trusting an ID from the client, and that endpoints deny by default.
How do we stop security scanners from turning into noise?
Start with a small rule set, give every finding an owner and a decision (fix now, accept with a reason and review date, suppress as a false positive, or escalate), and add rules once the team trusts the signal.