Secure development: which practices prevent vulnerabilities, and can you prove it?

This quarter, publish a vulnerability disclosure policy with a security.txt contact, block secrets at push and make review plus one precise static analysis check required before merge. Judge every other practice by whether it removes a whole class of bug by default or leaves evidence that a customer or regulator can check.

Reviewed
Next review
Version
1.2
Written for
Engineering leads, product security teams and developers who build and run their own software, from small product teams to regulated enterprises

If you only do five things

  1. Publish a disclosure policy and a contact.

    Authorize good-faith testing, rule out legal action against it, give a reporting channel and allow coordinated publication1. Serve /.well-known/security.txt with Contact, Policy and an Expires date under a year away2. From December 2027, the CRA requires a disclosure policy and a contact address3.

  2. Make the safe way the default way.

    Cross-site scripting and SQL injection top the 2025 CWE Top 254. Offer parameterized queries, auto-escaping templates and shell-free command APIs15. Write new components in memory-safe languages: memory safety bugs fell below 20% of Android's vulnerabilities in 20256.

  3. Block secrets before they reach the repository.

    Turn on push protection everywhere. On GitHub, private repositories need Secret Protection for it8; on GitLab, it takes Ultimate9. Rotate leaked secrets at once7, and load secrets from a secret manager, not code, images or environment variables10.

  4. Require review and one precise scanner before merge.

    On the default branch, require a pull request with one approval, Require approval of the most recent reviewable push and passing checks11. Run CodeQL's default suite12 and block high and critical alerts with Require code scanning results13.

  5. Fix by exploitation and publish what you fixed.

    Ship fixes within 90 days of a report, or 7 once exploited, per Google Project Zero14. Issue a CVE with CWE and CPE for each critical or high flaw that's exploited or that users must patch1.

Handle a vulnerability report

  1. Is it real?

    Acknowledge it within three business days and reproduce it before anyone spends a week. Expect volume: by April, curl got twice 2025's rate of reports, nearly all AI-assisted, and 15 to 16% were confirmed15.

  2. Is it exploited?

    Check CISA KEV, ENISA's EU KEV catalog16 and your own logs. If it is and the product is on the EU market, send an early warning through ENISA's platform within 24 hours318. The EU security laws sheet has the later clocks.

  3. When does the fix ship?

    Set the date by exploitation and exposure, then severity, and tell the reporter. On internet-facing services you run, an exploited flaw gets the patching sheet's 72 hours. If the fix will take longer, publish a workaround first20. Ship security fixes separately from feature updates where feasible, as the CRA requires3.

  4. What do you publish?

    An advisory with a CVE, a CVSS score and a CWE, crediting the reporter. NVD no longer routinely adds its own score where the CNA gave one19, so your record is what customers see.

  5. Where else is the same bug?

    Search for the pattern across the code base, add a regression test and a rule that catches the next one, as the SSDF advises20. The TypeScript, Rust and Python sheets list rules per language.

Automated checks that earn their place

  • Secret scanning with push protection. It covers Git history, issues and pull requests, and validity checks show which secrets still work7.
  • Dependency scanning. If a KEV-listed flaw in a component is exploitable in your product, CISA wants a free patch within 30 days of its fix5.
  • SAST with a precise rule set. Start with CodeQL's default suite, not the less precise security-extended12. Each month, tune out rules that are mostly false positives.
  • A DAST baseline in CI. ZAP's baseline scan spiders for a minute and doesn't attack, so it can run against production21.
  • Tests for what tools miss. Tools can't fully verify access control22, the top risk in the OWASP Top 10:202523. Test that one user can't reach another's records.

Before a risky change ships

  • Decide what counts as risky. Authentication, authorization, payments, uploads, parsers and new interfaces get a threat model and a reviewer who knows security. The NCSC wants closer oversight of AI-written code that handles authentication, sensitive personal data or secrets24.
  • Threat model it in half an hour. Ask what you're working on, what can go wrong, what you'll do about it and whether you did a good enough job, with STRIDE's six categories as prompts25. Keep the answers with the code.
  • Pick requirements from ASVS 5.0. Level 1 holds about 20% of some 350 requirements, and most applications should aim for Level 226. Cite them with the version, as in v5.0.0-1.2.526.
  • Ship secure defaults. No shared default passwords, MFA on for admins and logs for customers5. The CRA requires a secure default configuration and a reset3.

Evidence customers and regulators ask for

  • Answers to buyers' standard questions. CISA's Secure by Demand guide tells buyers to ask for a disclosure policy, CVEs with CWE and CPE fields, a plan to end vulnerability classes, an SBOM and MFA by default27.
  • A mapping to SSDF 1.1. Name the task each practice meets, such as PW.7.2 for code review20. US agencies may still ask for the attestation form, though it's no longer required28.
  • CRA technical documentation. Keep the risk assessment current and the documentation for 10 years or the support period, if longer. SaaS that isn't remote data processing for a product is outside the CRA3.

What changed in 2026

  • CRA reporting started. Since 11 September, manufacturers must report actively exploited vulnerabilities through ENISA's platform18. The Commission's draft guidance of 27 July explains scope, remote data processing and support periods29.
  • AI finds flaws at scale. The NCSC expects a forced correction of technical debt and an influx of updates of every severity30. Plan who fixes the findings before you scan with a model.
  • EU vendors can issue CVEs under ENISA. ENISA, a CVE Root since November 2025, had 20 CNAs by August, vendors among them17.

What you can skip

  • A paid bug bounty before you can triage. curl ended its bounty in early 2026 after a flood of AI-written junk reports15. A disclosure policy is free.
  • Black-box penetration tests. OWASP favors source-led tests, and it certifies no one for ASVS22.
  • Rewriting history after a leak. Revoke the secret. GitHub calls scrubbing history time-consuming and often unnecessary7.
  • Waiting for SSDF 1.2. NIST's December 2025 draft adds continuous improvement and staged updates with rollback31. Map to 1.1 now.

Mistakes that cost the most

  • Fixing silently. Customers can't tell they need the update, and the CRA requires public information on fixed vulnerabilities3.
  • Letting security.txt expire. Expires is required2. Put its renewal in the release calendar.
  • Merging AI-written code nobody read. Review, understand and check it where the stakes are high24. Require approval from someone other than the person who prompted the agent.

What this looks like at your size

Small team, no security staff

  • Turn on Dependabot, push protection and CodeQL. Private GitHub repos need the Team plan or higher, with paid Secret Protection and Code Security811.
  • Publish security.txt with a mailbox two people read, and require one review before merge.
  • Keep one list of open flaws with ship dates.

Growing, with IT or security staff

  • Name a product security owner and write playbooks for zero-days and exploited flaws20.
  • Threat model risky changes and take ASVS Level 2 for internet-facing apps.
  • Add a ZAP baseline scan against staging and report time to fix monthly.

Enterprise or regulated

  • Become a CNA, under ENISA's Root if it covers you17, and publish CVEs with CWE and CPE.
  • Keep CRA technical documentation per product, with risk assessment and vulnerability records.
  • Fork ASVS into an internal standard naming your approved libraries26.