Oleg
Chursin
WorkNotesPhotography
ASVS 5.0 as an engineering spec

How to turn OWASP ASVS 5.0.0 requirements into tagged tests, review records and a CI gate, and migrate 4.0.3 mappings without carrying stale tests forward.

Contents · 11 sections

A security questionnaire arrives with one line that matters: "Does the application meet OWASP ASVS Level 2?" Somebody says yes. Somebody else finds a spreadsheet from 2023 with 4.0.3 requirement numbers in column A and "done" in column C. Nobody can say which test proves which row, and almost every number in column A now points at a different requirement, or at nothing.

That is the normal state of ASVS adoption, and it isn't a tooling problem. ASVS is written as a list of verifiable statements, each with a pass or fail outcome, which makes it closer to an engineering specification than any other OWASP document. But a spec only helps if requirement identifiers are treated like an API, versions are pinned, and every requirement in scope points at evidence: a test, a review record, or a written reason it doesn't apply.

I read the 5.0.0 release the way I'd read a spec I had to implement: the front matter chapters, all of V3 and V7, every other requirement in the CSV export, and the official mapping files, which I also parsed and counted. Then I built a small Express app with Playwright tests tagged by requirement ID and a CI check that fails when an in-scope requirement has no evidence. One of those tests found a real gap in my own demo on its first run. This is part 2 of a series on reading security standards; part 1 covered what the OWASP Top 10 measures, and it ended by saying that ASVS, not the Top 10, is where requirements come from.

ASVS 5.0.0 is 345 verifiable goals, and Level 1 is a fifth of them

Versions and builds

The current stable release is ASVS 5.0.0, published on 30 May 2025. As of 18 October 2026 there is no 5.0.1 or 5.1: the repository's only release tags after 4.0.3 (October 2021) are v5.0.0_release and a moving tag called latest. The releases page puts that second one first. It's an automatically regenerated "Bleeding Edge" build of the master branch, last generated on 15 October 2026 at 06:24 UTC, and its description says it "should be used for testing and preview purposes only."

Both releases ship the same eleven assets: CSV, flat JSON, nested JSON, CycloneDX JSON, XML, DOCX and PDF, plus "legacy" CSV, JSON, flat JSON and XML variants. The Changes page explains the legacy files: 5.x writes levels as a number, and the legacy outputs keep 4.x's tick marks for backwards compatibility. GitHub's release API lists a SHA-256 digest for every bleeding-edge asset and none for the 5.0.0 assets, so if you want a hash for the stable files you compute it yourself.

I did, and got a useful result. Eight of the eleven 5.0.0 files I downloaded on 18 October (the CSV, flat JSON, nested JSON and XML, and all four legacy variants) hash to exactly the digests the bleeding-edge build lists for its files of the same name. In other words, almost 17 months after release, the requirement set on master is byte-for-byte the 5.0.0 set in every data format. The three that differ are the DOCX and PDF, which are rendered documents I didn't diff, and the CycloneDX export, for reasons covered further down. The bleeding-edge files are also still named ..._5.0.0_en.csv, and the nested JSON's Version field still says 5.0.0. Remember that when we get to pinning: a version string alone won't tell you which build you have.

The OWASP project page agrees in its own way. It says to "get the latest stable version of the ASVS (5.0.0)" and, in the sidebar, lists "Latest Version 5.0.0 (Bleeding Edge)". It names Daniel Cuthbert, Elar Lang and Josh Grossman as project leaders and classifies ASVS as a Flagship project.

The shape of 5.0

The preface says 5.0 "includes approximately 350 requirements across 17 chapters." Counting rows in the 5.0.0 CSV gives exactly 345, which matches the figure the Changes page uses. The chapter files and the CSV agree on the seventeen chapters:

Chapter Requirements L1 L2 L3
V1 Encoding and Sanitization 30 8 19 3
V2 Validation and Business Logic 13 4 7 2
V3 Web Frontend Security 31 8 11 12
V4 API and Web Service 16 2 8 6
V5 File Handling 13 4 5 4
V6 Authentication 47 13 22 12
V7 Session Management 19 6 12 1
V8 Authorization 13 4 3 6
V9 Self-contained Tokens 7 4 3 0
V10 OAuth and OIDC 36 5 24 7
V11 Cryptography 24 3 11 10
V12 Secure Communication 12 3 6 3
V13 Configuration 21 1 12 8
V14 Data Protection 13 2 7 4
V15 Secure Coding and Architecture 21 3 10 8
V16 Security Logging and Error Handling 17 0 16 1
V17 WebRTC 12 0 7 5
Total 345 70 183 92

The level columns count the level at which a requirement first applies; the CSV's L column holds a single number. The What is the ASVS chapter describes the split in round numbers: Level 1 is "around 20%" of requirements, around 50% are L2, so L2 compliance means implementing "around 70%" of the standard, and L3 adds "the final ~30%". The exact shares are 20.3% L1, 53.0% L2 (73.3% cumulative) and 26.7% L3.

The bigger change is philosophical. The Changes page says 5.0 requirements "are centered on security goals, referencing particular mechanisms only when they are the sole practical solution." The scope section of What is the ASVS states the testability rule: "The requirement must be verifiable, and the verification must result in a 'fail' or 'pass' decision." And it adds a new class of requirement, "documented security decisions", which the next sections deal with at length because they are where automation stops.

Level 1 also shrank on purpose. Per the Changes page, 4.0.3 had "128 L1 requirements out of a total of 278 requirements, representing 46%," while 5.0.0 has "70 L1 requirements out of a total of 345 requirements, representing 20%." The stated reason is adoption: a large "minimum" level that wasn't good enough for most applications discouraged teams from starting.

A requirement ID is only meaningful with its version

Every ASVS 5 requirement has an identifier of the form <chapter>.<section>.<requirement>. What is the ASVS spells out the consequence: "Since the identifiers may change between versions of the standard, it is preferable for other documents, reports, or tools to use the following format: v<version>-<chapter>.<section>.<requirement>." Its example is v5.0.0-1.2.5, OS command injection. The v must be lowercase. And an unversioned ID "should be assumed to refer to the latest" content, which the standard itself calls "problematic" as it changes.

Treat that format as an API contract. A bare 3.4.1 in a test name is a dangling pointer: in 5.0.0 it's HSTS, in 4.0.3 it was the Secure attribute on session cookies. You can see the confusion in the wild. The A05:2025 Injection page points readers to "OWASP ASVS: V5 Input Validation and Encoding", which is 4.x chapter naming; in 5.0, V5 is File Handling and input validation lives in V2. Meanwhile A04:2025 links to the 5.0 chapters V11, V12 and V14. Same edition of the Top 10, two generations of ASVS numbering.

What each kind of release is allowed to change

The release strategy in What is the ASVS reads like semantic versioning for requirements:

  • Major (4.0.3 to 5.0.0): "Full reorganization, almost everything may have changed, including requirement numbers. Reevaluation for compliance will be necessary."
  • Minor (5.0.0 to 5.1.0): "Requirements may be added or removed, but overall numbering will stay the same. Reevaluation for compliance will be necessary, but should be easier."
  • Patch (5.0.0 to 5.0.1): "Requirements may be removed (for example, if they are duplicates or outdated) or made less stringent, but an application that complied with the previous release will comply with the patch release as well."

Changes to surrounding text and appendices "will not be considered to be a breaking change." So the contract covers requirement text, not the prose around it.

That maps directly onto a CI rule. Pin the ASVS version in one place. Tag every test and review record with the fully qualified ID. When someone bumps the pinned version, the build fails until every tag has been re-pointed and reviewed. A patch bump should be cheap under that rule, since it can only remove or relax requirements. A minor bump means re-reading every requirement you test. A major bump means starting the mapping again with the official files.

The contract now has a change-control process, but nothing has gone through it

There was pressure on that contract before the first patch shipped. A v5.0.1 milestone was created on 18 September 2025 with a due date of 30 May 2026; as of 18 October 2026 it's still open with no issues attached. One open issue carries the v5.0.1 label: #3224, which asks for 3.2.2 to mention framework text bindings next to textContent. On 19 February 2026 Josh Grossman, one of the project leaders, wrote that he was comfortable with a proposed new wording and added, "We need to wait for change control to be put in place." Seven open issues carry a requires change control label.

Four days later the process landed. Pull request #3336, merged on 23 February 2026, added a change-control section to the project's CONTRIBUTING.md. Changes go onto the bleeding-edge branch with a tag at the start of the requirement text that says which kind of release can carry them: [P:WEAKENED], [P:DELETED] and [P:WORDING] for a patch, and [I:ADDED], [I:STRENGTHENED], [I:TRANSFORMED] and the merge and split tags for a minor. A patch branch is cut by reverting every change whose tag isn't a P. The same file restates the release strategy more precisely than the 5.0.0 text does: a minor release may raise or lower a requirement's level, and a patch may raise it but never lower it.

#3305 shows how that's meant to work. It argues that 6.5.7 conflicts with NIST SP 800-63B-4 by allowing biometrics as a second factor alongside "something you know". The agreed fix removes that option, which makes the requirement stricter. In November 2025 Grossman said they'd try to get it in "when we figure out how we are going to handle breaking changes." In July 2026 he corrected himself: "Making a requirement stricter is [I:STRENGTHENED], which is fine for a minor release." So if that wording lands, it lands in a 5.1, not a 5.0.1. As of 18 October 2026 no requirement on master carries one of these tags (the bleeding-edge flat JSON is still identical to 5.0.0), so the process is defined but unused. That's the scenario a version pin protects you from: the text of a requirement you've already tested can change under you, and you want the build to tell you.

The 4.0.3 mapping says "moved" where the text changed

If you have a 4.x mapping, 5.0 breaks it on purpose. The Changes page puts numbers on the churn: "Of the 286 requirements in version 4.0.3, only 11 remain unchanged, while 15 have undergone minor grammatical adjustments without altering their meaning. In total 109 requirements (38%) are no longer separate requirements in version 5.0 with 50 simply being deleted, 28 removed as duplicates and 31 merged into other requirements." And "even requirements that were not substantively modified have different identifiers."

4.0.3 had 278 live requirements, not 286

The same page uses two different totals for 4.0.3: 286 in the churn paragraph and 278 in the Level 1 comparison. It looks like an error, and the 4.0.3 CSV explains it. The CSV has 286 rows, but 8 of them are numbered placeholders already marked as deleted in 4.0.3 itself: V1.4.2 [DELETED, NOT ACTIONABLE], V7.3.2 [DELETED, DUPLICATE OF 7.3.1] and six more. So 4.0.3 had 278 live requirements. The forward mapping file has exactly 278 entries, one per live requirement. The 109 removals are 38.1% of 286 or 39.2% of 278. When you quote the churn, say "109 of 278 live requirements".

Two mapping files that disagree about what changed

The mapping README lists the official files. Two matter for migration: mapping_v4.0.3_to_v5.0.0.yml (keyed by old ID) and mapping_v5.0.0_to_v4.0.3.yml (keyed by new ID). Each entry is a status string like MOVED TO v5.0.0-7.2.4 or DELETED, MERGED TO v5.0.0-7.2.3.

I parsed both. The forward file's 109 DELETED entries break down exactly as the prose says: 31 MERGED TO, 28 duplicates (27 COVERED BY and one DEPRECATED BY), and 50 plain deletions (27 NOT IN SCOPE, 11 INSUFFICIENT IMPACT, 7 NOT PRACTICAL, 5 INCORRECT). The reverse file has 345 entries: 189 ADDED, 130 MODIFIED, 15 GRAMMAR and 11 MOVED. Those last two numbers match the "11 unchanged, 15 grammatical" on the Changes page, so the reverse file agrees with the prose.

The forward file is less careful. It does have a MODIFIED flag, and uses it on 61 entries, but it marks 84 other old requirements with a bare MOVED TO. The reverse file marks 69 of those 84 targets as MODIFIED and 4 as GRAMMAR. Only 11 are really just moves. And some of the "moves" are substantive changes:

4.0.3 requirement Forward file 5.0.0 target Reverse file What changed
3.2.2: session tokens have at least 64 bits of entropy MOVED TO 7.2.3 MODIFIED, MERGED FROM 3.2.4 128 bits, CSPRNG, reference tokens only
14.4.5: HSTS example max-age=15724800 MOVED TO 3.4.1 MODIFIED at least one year; subdomains from L2
3.4.1: Secure on cookie-based session tokens MOVED TO 3.3.1 MODIFIED all cookies, plus __Secure- or __Host- prefix
3.2.1: new session token on authentication MOVED TO 7.2.4 MODIFIED also on re-authentication; old token terminated

The first row is the one to worry about. A script that rewrites tags using only the forward file would relabel a test asserting 64 bits of entropy as evidence for a requirement that demands 128. The test would still pass and the report would say compliant. Fig. 1 traces ten 4.0.3 requirements through both files, seven of them from 4.0.3's V3 Session Management chapter; watch the red one.

A migration script that reads both directions

So migrate with both files. For each old tag, take the targets from the forward file, then look each target up in the reverse file. Only a reverse entry of exactly MOVED FROM <old id> means the text didn't change. Everything else needs a person to re-read the requirement and the test. This uses the yaml package from npm (2.9.1 in my run) on Node 24:

scripts/asvs-migrate.mjs
import { readFile } from 'node:fs/promises';
import { parse } from 'yaml';

const load = async (f) => parse(await readFile(`asvs/${f}`, 'utf8'));
const forward = await load('mapping_v4.0.3_to_v5.0.0.yml');
const reverse = await load('mapping_v5.0.0_to_v4.0.3.yml');

// Usage: node scripts/asvs-migrate.mjs v4.0.3-3.2.2 v4.0.3-14.4.4 ...
for (const oldId of process.argv.slice(2)) {
  const status = forward[oldId]?.['tag-v5.0.0'];
  if (!status) { console.log(`${oldId}: not in the mapping`); continue; }
  const targets = status.match(/v5\.0\.0-[\d.]+/g) ?? [];
  if (targets.length === 0) {
    console.log(`${oldId}: drop (${status})`);
    continue;
  }
  for (const newId of targets) {
    const back = reverse[newId]?.['tag-v4.0.3'] ?? '';
    // Only a bare "MOVED FROM <oldId>" means the text did not change.
    const verdict = back === `MOVED FROM ${oldId}` ? 'renumber' : 'RE-REVIEW';
    console.log(`${oldId} -> ${newId}: ${verdict} (${back})`);
  }
}

Run on a few IDs, it prints:

v4.0.3-3.2.2 -> v5.0.0-7.2.3: RE-REVIEW (MODIFIED, MOVED FROM v4.0.3-3.2.2, MERGED FROM v4.0.3-3.2.4)
v4.0.3-14.4.4 -> v5.0.0-3.4.4: RE-REVIEW (GRAMMAR, MOVED FROM v4.0.3-14.4.4)
v4.0.3-1.1.1: drop (DELETED, NOT IN SCOPE)
v4.0.3-3.3.2 -> v5.0.0-7.3.2: RE-REVIEW (MODIFIED, MOVED FROM v4.0.3-3.3.2)
v4.0.3-3.3.2 -> v5.0.0-7.3.1: RE-REVIEW (ADDED, SPLIT FROM v4.0.3-3.3.2)
v4.0.3-1.4.3: not in the mapping

The last line is one of the eight 4.0.3 placeholders: there's nothing to map because it was already gone. I treat GRAMMAR as re-review too, because a skim costs little and the label is a human judgment. Run over all 278 forward entries, the script prints 10 renumber-only pairs, 256 pairs to re-review and 50 drops. That's the honest size of a 4.0.3 migration: almost everything needs a human look, which is what the release strategy said a major release would mean.

Pin the mapping commit, not just the version

The Changes page warns that the mappings "are not tied to release versioning and may be updated or clarified as needed." That already happened. On 2 June 2025, three days after release, commit 817d521 corrected how 4.0.3-2.1.7 maps in both files, adding 6.2.10 as one of its split targets. The files at the v5.0.0_release tag don't have that fix; master does. And master isn't final either. Issue #3344, open since March 2026, reports that both files still describe v5.0.0-13.2.4 as a modified 4.0.3-4.3.3, even though 13.2.4's text now covers a different topic. According to the issue, the 4.3.3-derived wording was overwritten by accident in April 2025, during the 5.0 drafting. A fix is proposed in pull request #3373, still open as of 18 October 2026. The both-directions rule above would flag that pair for re-review anyway, which is the point of the rule. Vendor the two YAML files into your repository at a named commit, and record the commit hash next to them.

Most of V3 can be checked at the HTTP boundary

V3 Web Frontend Security is new as a chapter in 5.0. The Changes page says frontend requirements were separated out because of "the increasing complexity of browser-based applications and the rise of API-only architectures." Its control objective says the requirements "do not apply to machine-to-machine solutions", which is the first scoping decision to write down.

V3 is the friendliest chapter for automation, because most of its requirements are statements about response headers and cookies. Those are black-box properties: send a request, inspect the response. I went through all 31 requirements and sorted them by the cheapest method that can produce a pass or fail decision. This is my classification, not OWASP's. The method was to ask, for each requirement, whether a request-and-response check against a running app is enough, whether it needs app internals (a browser, a fake clock, a second user, an admin API), whether it needs someone reading code, or whether it's about a document.

  • HTTP probe, 20 requirements. Cookie setup (3.3.1 to 3.3.5), all eight header requirements in 3.4, the request-forgery checks 3.5.1, 3.5.2, 3.5.3 and 3.5.8 (send the forged request, expect a rejection), 3.2.1 (request an API or upload directly, check the response can't render in the wrong context), 3.7.2 (redirect allowlist) and 3.7.4 (HSTS preload status, checked against the preload list).
  • Integration harness, 3. 3.5.5 needs a page in a second origin posting messages; 3.7.3 and 3.7.5 are user-facing behaviors (an off-site redirect warning with a cancel option, and documented behavior when the browser lacks a feature).
  • Code review, 6. 3.2.2 (text rendered as text), 3.2.3 (DOM clobbering), 3.5.6 (no JSONP anywhere), 3.5.7 (no authorized data in script responses), 3.6.1 (SRI on externally hosted assets) and 3.7.1 (no obsolete client technology). Several can be backed by a lint rule or a scan of built HTML, but the pass decision still comes from reading code.
  • Design or document review, 2. 3.1.1 (documentation states which browser security features the app relies on) and 3.5.4 (separate applications on separate hostnames).

It's tempting to put 3.2.2 in the harness column, and I'd resist that. A DOM test can show that one field renders as text. The requirement is about all content "intended to be displayed as text", which only a review of every rendering path, ideally enforced by a lint rule against innerHTML and its framework equivalents, can cover.

The tests

The demo is a 53-line Express 5.3.0 app with a cookie session, tested with Playwright 1.64.1 on Node 24.18.0. The tests use only Playwright's request fixture, so they run without any browser installed; I checked by pointing PLAYWRIGHT_BROWSERS_PATH at an empty directory. Every test carries its requirement IDs as Playwright tags, which "must start with @" and can be filtered with --grep. One helper keeps the version in a single place:

tests/asvs.ts
// Every test names the exact requirements it verifies, version included.
export const ASVS_VERSION = '5.0.0';

export const asvs = (...ids: string[]) => ({
  tag: ids.map((id) => `@asvs:v${ASVS_VERSION}-${id}`),
});

The app sets its security headers in one middleware and keeps sessions in memory. The login route skips the credential check on purpose: the demo exists to exercise session handling, so don't copy that part anywhere.

app.mjs
app.use((req, res, next) => {
  res.set({
    'Strict-Transport-Security': 'max-age=31536000; includeSubDomains',
    'X-Content-Type-Options': 'nosniff',
    'Content-Security-Policy':
      "default-src 'self'; object-src 'none'; base-uri 'none'; " +
      "frame-ancestors 'none'",
    'Cross-Origin-Opener-Policy': 'same-origin',
  });
  next();
});

const sidFrom = (req) =>
  req.get('cookie')?.match(/(?:^|;\s*)__Host-sid=([^;]+)/)?.[1];

const COOKIE = 'Path=/; Secure; HttpOnly; SameSite=Lax';

app.post('/login', (req, res) => {
  // Credential check omitted: this demo only exercises session handling.
  sessions.delete(sidFrom(req)); // 7.2.4: terminate the current token
  const sid = randomBytes(32).toString('base64url'); // 256 bits, CSPRNG
  sessions.set(sid, { userId: req.body.userId });
  res.set('Set-Cookie', `__Host-sid=${sid}; ${COOKIE}`).json({ ok: true });
});

The rest of the file is the imports (express, randomBytes from node:crypto), express.json(), a sessions Map, a logout route that deletes the session and expires the cookie, a /me route that returns 401 without a valid session, a one-line HTML home page and app.listen.

Header requirements become loops over a list of paths. The list includes an error path on purpose:

tests/v3-headers.spec.ts
import { test, expect } from '@playwright/test';
import { asvs } from './asvs';

// Include an error path: headers set only on success routes are a classic gap.
const paths = ['/', '/me', '/does-not-exist'];

test('HSTS: max-age of at least a year, subdomains included',
  asvs('3.4.1'), async ({ request }) => {
    for (const path of paths) {
      const res = await request.get(path);
      const hsts = res.headers()['strict-transport-security'];
      const maxAge = Number(hsts?.match(/max-age=(\d+)/i)?.[1] ?? 0);
      expect(maxAge, path).toBeGreaterThanOrEqual(31_536_000);
      expect(hsts, path).toMatch(/includesubdomains/i); // L2 and up
    }
  });

test('CSP baseline and frame-ancestors on every response',
  asvs('3.4.3', '3.4.6'), async ({ request }) => {
    for (const path of paths) {
      const res = await request.get(path);
      const csp = res.headers()['content-security-policy'];
      expect(csp, path).toContain("object-src 'none'");
      expect(csp, path).toContain("base-uri 'none'");
      expect(csp, path).toMatch(/frame-ancestors\s/);
    }
  });

The same file has a nosniff test for 3.4.4 and a COOP test for 3.4.8 that first asserts the response is text/html, since 3.4.8 only covers "responses that initiate a document rendering." 31,536,000 seconds is 365 days, the floor 3.4.1 sets with "a maximum age of at least 1 year."

What the first run found

The CSP test failed on its first run, on /does-not-exist. My app sets security headers in a middleware that runs before every route, so I expected the 404 to carry them. It didn't: the 404 response's policy was default-src 'none' and nothing else. Express hands unmatched requests to its final handler, and finalhandler 2.1.1 sets its own Content-Security-Policy and X-Content-Type-Options on the error pages it writes, replacing what the middleware set.

default-src 'none' is a strict policy, so is this a real failure? Against the letter of 3.4.6, yes. CSP Level 3 says frame-ancestors "will not fall back to the default-src directive's value," so the 404 page can be framed by anyone. base-uri is a document directive, and only fetch directives use the fallback list, so 3.4.3's base-uri 'none' is missing too. A framed 404 page is low risk. But 3.4.6 says "every HTTP response," and the point of the test is that it holds you to what the requirement says rather than what you assumed. The fix is to own the 404 and error responses:

app.mjs
 app.get('/', (req, res) => res.type('html').send('<!doctype html><p>Home'));

+// Own the 404 and error responses: Express's built-in final handler
+// replaces the CSP with its own on the responses it generates.
+app.use((req, res) => res.status(404).json({ error: 'not found' }));
+app.use((err, req, res, next) => res.status(500).json({ error: 'internal' }));
+
 app.listen(Number(process.env.PORT ?? 3000));

With that change all eight tests pass. The lesson generalizes beyond Express: header requirements say "all responses", and the responses you didn't write (framework error pages, proxy errors, static file handlers, CDN edge responses) are where they fail. Probe at least one path per response producer, and run the probes against the deployed stack as well as the local server, because in production the CDN is a response producer too.

The cookie test reads the raw Set-Cookie header from the login response rather than relying on a cookie jar, because what's being verified is the header the server sends. The session tests share two helpers that send cookies by hand:

tests/session.spec.ts
import { test, expect, type APIRequestContext } from '@playwright/test';
import { asvs } from './asvs';

// Log in, optionally sending an existing session cookie.
async function login(request: APIRequestContext, current?: string) {
  const res = await request.post('/login', {
    data: { userId: 'u_123' },
    headers: current ? { cookie: `__Host-sid=${current}` } : {},
  });
  const setCookie = res.headers()['set-cookie'] ?? '';
  const sid = setCookie.match(/^__Host-sid=([^;]+)/)?.[1] ?? '';
  return { setCookie, sid };
}

const me = (request: APIRequestContext, sid: string) =>
  request.get('/me', { headers: { cookie: `__Host-sid=${sid}` } });

test('session cookie: __Host- prefix, Secure, HttpOnly, SameSite',
  asvs('3.3.1', '3.3.2', '3.3.3', '3.3.4'), async ({ request }) => {
    const { setCookie } = await login(request);
    expect(setCookie).toMatch(/^__Host-sid=/);
    expect(setCookie).toMatch(/;\s*Secure/i);
    expect(setCookie).toMatch(/;\s*HttpOnly/i);
    expect(setCookie).toMatch(/;\s*SameSite=(Lax|Strict)/i);
    expect(setCookie).not.toMatch(/;\s*Domain=/i);
  });

Two caveats keep this honest. 3.3.2 requires SameSite to be "set according to the purpose of the cookie", and a test can only check that an expected value is present; whether Lax is right for this cookie is a design decision. And 3.3.4 has two halves: the HttpOnly attribute, and the session value being "only transferred to the client via the 'Set-Cookie' header field." The second half is a code-review question (does any JSON response echo the token?). MDN now documents __Http- and __Host-Http- prefixes, which require HttpOnly to "prove that they were set via the Set-Cookie header." That covers cookies only, not a token echoed in a JSON body, and support is partial: as of 18 October 2026, MDN's compatibility data lists them in Chrome 140 and Firefox 143 and not in Safari. So the demo sticks with __Host-.

V7 needs an integration harness and a few documents

V7 Session Management has 19 requirements, and it looks very different. Its first section is three documentation requirements. 7.1.1 asks that the "session inactivity timeout and absolute maximum session lifetime are documented, are appropriate in combination with other controls," including justification for deviations from NIST SP 800-63B re-authentication requirements. 7.1.2 covers the concurrent-session limit and what happens when it's reached, and 7.1.3 covers coordination with SSO systems. The section intro explains why: "There is no single pattern that suits all applications."

Then the implementation requirements refer back to those decisions. 7.3.1 and 7.3.2 require timeouts enforced "according to risk analysis and documented security decisions." That's the pattern What is the ASVS describes: documentation requirements "are always in the first section of a chapter" and "always have a related implementation requirement," and "verifying that the documentation is in place and that the actual implementation are two separate activities."

Using the same method as V3, my split for V7 is:

  • HTTP probe, 2. 7.2.4 (new token on authentication and re-authentication, old one terminated) and 7.4.1 (no further use after logout or expiry).
  • Integration harness, 11. Timeouts (7.3.1, 7.3.2) need a controllable clock. Disabling an account (7.4.2), terminating sessions after a factor change (7.4.3), visible logout on every authenticated page (7.4.4), admin termination (7.4.5), re-authentication before sensitive changes (7.5.1 to 7.5.3) and the federated requirements (7.6.1, 7.6.2) all need a second actor, an admin API, a browser crawl or an IdP in the test environment.
  • Code review, 3. 7.2.1 (verification in a trusted backend), 7.2.2 (dynamic tokens rather than static API keys) and 7.2.3 (CSPRNG and 128 bits for reference tokens).
  • Document review, 3. 7.1.1 to 7.1.3.

Fig. 2 puts the two chapters side by side. V3 sorts mostly into HTTP probes; V7 mostly into the harness column, and five of the fifty requirements can only ever be checked against a document.

Two session tests, and one that's only a smoke test

The demo's login handler deletes any current session and issues a 256-bit token from randomBytes(32). Because the helpers send cookies by hand, the tests can replay an old token:

tests/session.spec.ts
test('re-authentication issues a new token and kills the old one',
  asvs('7.2.4'), async ({ request }) => {
    const first = await login(request);
    const second = await login(request, first.sid);
    expect(second.sid).not.toBe(first.sid);
    expect((await me(request, first.sid)).status()).toBe(401);
    expect((await me(request, second.sid)).status()).toBe(200);
  });

test('logout makes the token unusable', asvs('7.4.1'),
  async ({ request }) => {
    const { sid } = await login(request);
    await request.post('/logout', {
      headers: { cookie: `__Host-sid=${sid}` },
    });
    expect((await me(request, sid)).status()).toBe(401);
  });

The 7.4.1 test checks the server side, which is what the requirement asks for: "the application disallows any further use of the session," which for stateful sessions "means invalidating the session data at the application backend." Clearing the cookie in the browser doesn't satisfy it, and a test that only checks for a Max-Age=0 cookie would pass an app that leaves the session alive.

7.2.3 is where I have to be careful about what a test proves. The requirement is that reference tokens are "unique and generated using a cryptographically secure pseudo-random number generator (CSPRNG) and possess at least 128 bits of entropy." Entropy is a property of the generator, not of a sample. A test can collect tokens and check their decoded length and uniqueness, which catches a truncated token or a counter, but a token that is 32 bytes of SHA-256(userId + Date.now()) would pass both checks and have nowhere near 128 bits. So my demo has a smoke test tagged 7.2.3, and the requirement's pass decision still needs a code-review record pointing at the generator. The check script below accepts either kind of evidence, which is the first simplification I'd remove in a real codebase: some requirements need both.

Testable is not the same as automatable

ASVS says this itself, in two places. The Changes page has a section called "The Fallacy of Testability." In 4.x, Level 1 was chosen partly for what black-box penetration testing could assess, and 5.0 rejects that: "The fact that a requirement is testable does not guarantee that it can be tested in an automated or straightforward manner. Moreover, the most easily testable requirements are not always those with the greatest security impact or the simplest to implement." Levels in 5.0 were set "primarily based on risk reduction and also keeping in mind the effort to implement."

The Assessment and Certification chapter adds the practical version. DAST and SAST tools may cover "basic and straightforward technical requirements," but "these tools will be unable entirely to verify many of the more complicated ASVS requirements or those that relate to business logic and access control." For the rest, "application specific verifications will need to be written," similar to existing unit and integration tests. It sums up: "testable using automation != running an off the shelf tool."

That matches what V3 and V7 showed. Across the two chapters, 22 of 50 requirements yield to HTTP probes, 14 need a harness that knows the application, 9 need code review and 5 need a document. Even the probes are app-specific: which endpoints are "sensitive functionality" for 3.5.3 is something only your team knows.

Documented decisions can only be checked for presence

Across the standard, 31 requirements sit in a chapter's documentation section: 11 of the 17 chapters open with one (V2, V3, V5, V6, V7, V8, V11, V13, V14, V15 and V16). Four are L1, 17 are L2 and 10 are L3, so an L2 target carries 21 of them. Another 22 requirements outside those sections refer to documentation or documented decisions in their text, usually "according to the application's documentation" or "documented security decisions." What is the ASVS is clear that these decisions belong to the organization: "it is not expected that individual developers will be making and documenting these decisions," and they can live in "a literal document" or "a common code library that all developers are mandated to use."

CI can check that such a document exists, that it was reviewed by someone, and when. It can't check that a 12-hour absolute session lifetime is "appropriate in combination with other controls." Treat documentation requirements as review artifacts checked into the repository, with an owner and a review date, and let the build enforce their presence and freshness, not their content.

A rough map of all seventeen chapters

I went through every requirement in the 5.0.0 CSV, and here is where I think each chapter's verification effort lands. It's my judgment from the requirement texts, not OWASP's classification, and it's per chapter, so every chapter has exceptions:

Chapter Docs section Where most of the verification lands
V1 Encoding and Sanitization 0 Code review and SAST, with targeted injection tests
V2 Validation and Business Logic 3 Harness tests of business flows, against documented rules
V3 Web Frontend Security 1 HTTP probes
V4 API and Web Service 0 HTTP probes; HTTP/2 framing needs specialized tooling
V5 File Handling 1 Harness tests with crafted uploads
V6 Authentication 3 Harness tests of auth flows; password rules are probe-able
V7 Session Management 3 Harness tests
V8 Authorization 4 Harness tests with a user and tenant matrix
V9 Self-contained Tokens 0 Unit and harness tests with forged tokens
V10 OAuth and OIDC 0 Harness tests; many are authorization-server configuration
V11 Cryptography 4 Code review and a cryptographic inventory
V12 Secure Communication 0 TLS scanning for external endpoints, config review inside
V13 Configuration 4 Config review; leak checks (13.4.x) are HTTP probes
V14 Data Protection 2 Document and code review; cache headers are probe-able
V15 Secure Coding and Architecture 5 Code review and dependency tooling
V16 Security Logging and Error Handling 1 Harness tests that assert log events, plus review
V17 WebRTC 0 Specialized media and signaling harnesses

The table also suggests where to start. If your app has a browser frontend, I'd expect V3 to give the most requirements per hour of test-writing, since probes are the cheapest tests to write. For an API, V4 and V9 look like the next best. The chapters dominated by code review and documents are where ASVS adoption actually costs time, and no amount of CI wiring changes that.

A lock file turns the standard into a build input

Here is the plumbing that ties it together. The standard's requirement list is a build input, like a dependency. Pin it, hash it, and fail the build when the evidence doesn't cover the scope.

The pin is a small JSON file next to the vendored export. I use the flat JSON because it parses with no dependencies and has the same fields as the CSV: chapter_id, section_id, req_id, req_description and L. It doesn't carry a version field, which is why the lock records the SHA-256 digest:

asvs.lock.json
{
  "asvs": "5.0.0",
  "source": {
    "file": "asvs/asvs-5.0.0.flat.json",
    "sha256": "8201b20eec2908c3380ac600c91c8ba746346fbb808859366abb232027532311"
  },
  "target": { "level": 2, "chapters": ["V3", "V7"] },
  "records": {
    "v5.0.0-7.1.1": {
      "kind": "document",
      "path": "docs/security/sessions.md",
      "reviewedBy": "appsec",
      "reviewedOn": "2026-10-12"
    },
    "v5.0.0-7.6.1": {
      "kind": "not-applicable",
      "reason": "No federated login; sessions are local only."
    }
  }
}

That digest is the one I computed for the 5.0.0 release's flat JSON, and it's also the digest the bleeding-edge build lists today. Suppose OWASP changes a requirement on master and someone later refreshes the vendored file from the bleeding-edge build. The file name and the 5.0.0 label would stay the same, and the hash is the only thing in this setup that would notice.

The check script runs in three steps. First, verify the vendored file against the pin:

scripts/asvs-check.mjs
import { readFile, access } from 'node:fs/promises';
import { createHash } from 'node:crypto';
import { execFileSync } from 'node:child_process';

const lock = JSON.parse(await readFile('asvs.lock.json', 'utf8'));
const errors = [];

const raw = await readFile(lock.source.file);
const digest = createHash('sha256').update(raw).digest('hex');
if (digest !== lock.source.sha256) {
  errors.push(`${lock.source.file}: sha256 ${digest} is not the pinned one`);
}
const all = JSON.parse(raw).requirements;
const known = new Set(all.map((r) => `v${lock.asvs}-${r.req_id.slice(1)}`));

Second, collect tags from the test suite without running it. playwright test --list --reporter=json lists every test with its tags; in 1.64.1 the JSON reporter drops the leading @. Any tag that names a different version, or an ID the pinned standard doesn't have, is an error:

scripts/asvs-check.mjs
const report = JSON.parse(execFileSync(
  'npx', ['playwright', 'test', '--list', '--reporter=json'],
  { encoding: 'utf8' },
));
const tested = new Map(); // id -> test titles
const walk = (suite) => {
  for (const spec of suite.specs ?? []) {
    for (const tag of spec.tags.filter((t) => t.startsWith('asvs:'))) {
      const id = tag.slice('asvs:'.length);
      if (!known.has(id)) {
        errors.push(`unknown or stale tag ${tag}: ${spec.title}`);
      }
      tested.set(id, [...(tested.get(id) ?? []), spec.title]);
    }
  }
  (suite.suites ?? []).forEach(walk);
};
report.suites.forEach(walk);

Third, every in-scope requirement needs a test, a review record whose file exists, or a not-applicable reason:

scripts/asvs-check.mjs
const inScope = all.filter((r) =>
  Number(r.L) <= lock.target.level &&
  lock.target.chapters.includes(r.chapter_id));

let missing = 0;
for (const r of inScope) {
  const id = `v${lock.asvs}-${r.req_id.slice(1)}`;
  const record = lock.records[id];
  if (tested.has(id)) continue;
  if (record?.kind === 'not-applicable' && record.reason) continue;
  if (record?.kind === 'document' || record?.kind === 'code-review') {
    try { await access(record.path); continue; } catch {}
    errors.push(`${id}: review record points to missing ${record.path}`);
    continue;
  }
  errors.push(`${id} (L${r.L}) has no test, review record or reason`);
  missing++;
}

console.log(`ASVS ${lock.asvs} L${lock.target.level}: ` +
  `${inScope.length} in scope, ${missing} unaccounted for`);
if (errors.length) {
  console.error(errors.join('\n'));
  process.exit(1);
}

Against the demo, with eight tests and the two records above, it fails, which is the right answer:

ASVS 5.0.0 L2: 37 in scope, 24 unaccounted for
v5.0.0-3.2.1 (L1) has no test, review record or reason
v5.0.0-3.2.2 (L1) has no test, review record or reason
v5.0.0-3.4.2 (L1) has no test, review record or reason
...
v5.0.0-7.6.2 (L2) has no test, review record or reason

V3 and V7 have 37 requirements at L1 or L2. The tests cover 11 of them, the session document covers 7.1.1 and the not-applicable record covers 7.6.1; 24 remain. When I added a test tagged @asvs:v4.0.3-3.4.1 to check the stale-tag rule, the script reported "unknown or stale tag asvs:v4.0.3-3.4.1" and failed. Fig. 3 shows the gate filling up.

In GitHub Actions it's two steps after install. The current majors of actions/checkout and actions/setup-node are v7 as of October 2026:

.github/workflows/asvs.yml
name: asvs
on: [pull_request]
jobs:
  asvs:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v7
      - uses: actions/setup-node@v7
        with:
          node-version: 24
      - run: npm ci
      - run: node scripts/asvs-check.mjs
      - run: npx playwright test

Order matters: the coverage check runs first and is cheap, so a pull request that removes a test's tag fails before the suite runs. Two extensions are worth adding once the basics work. Fail when a document record's reviewedOn is older than your review cycle. And for requirements like 7.2.3, allow a record to require both a test and a code review.

CycloneDX can carry the standard, but check which export you use

The CycloneDX specification overview describes two features built for this. "Definitions" hold standards, requirements and levels, and it says "security standards such as OWASP ASVS, MASVS, SCVS, and SAMM are available in CycloneDX format." "Declarations describe the conformance to standards," with attestations, claims and evidence, and the page calls them "the basis for 'compliance-as-code'." The current version is 1.7, released 2025-10-21, and the page lists it as Ecma standard ECMA-424, published 2025-12-10. In principle, the lock file above could be a CycloneDX declaration that travels with your SBOM.

In practice, the 5.0.0 release's CycloneDX asset has two problems. Its levels arrays are empty, so you can't tell which requirements belong to which level, reported in issue #3198. And it puts standards under declarations, which issue #3354 says makes it invalid: the 1.6 schema only defines standards under definitions, and declarations doesn't allow extra properties. I checked the file I downloaded on 18 October: spec version 1.6, standards under declarations, all three level lists empty. Validated against the 1.6 schema with Python's jsonschema 4.26.0, it fails with "Additional properties are not allowed ('standards' was unexpected)". Both were fixed on master, the levels in June 2025 and the schema placement by pull request #3355 in July 2026, and the bleeding-edge CycloneDX export now declares spec 1.7, puts the standard under definitions and fills the levels with 70, 183 and 92 requirements; it validates against the 1.7 schema with no errors. But the 5.0.0 release asset wasn't regenerated. So the only valid CycloneDX ASVS is the one OWASP labels "testing and preview purposes only." For now I'd keep the source of truth in the flat JSON and generate CycloneDX from it if a customer asks. A later part of this track covers SBOMs and CycloneDX 1.7 in depth.

Any mapping from ASVS to the Top 10 is now your own artifact

People will ask which Top 10 categories your ASVS work covers. The two documents used to meet at CWE: 4.0.3's CSV has a cwe column, filled for 268 of its 286 rows, and the Top 10:2025 introduction builds every category from CWEs, "248 CWEs within the 10 categories." The Changes page ends that link. "Direct mappings to CWE and NIST are no longer maintained," because of "category-only CWEs, difficulties in mapping requirements to a single CWE, and the presence of imprecise mappings in version 4.x." The stated plan is a mapping through the OWASP Common Requirement Enumeration (CRE) project instead. As of 18 October 2026, OpenCRE's API returns 277 ASVS entries, and every one links to the v4.0.3 text.

What's left is an archive. The mapping README lists v5.0.be_cwe_mapping.json as a "just-in-case" export taken before the CWE column was removed. It maps 212 requirement IDs to one CWE each, 120 distinct CWEs in all. Those IDs are v5.0.be, the intermediate numbering that kept 4.0 structure, so using them with 5.0.0 means chaining through mapping_v5.0.be_to_v5.0.0.yml.

I ran the chain. 204 of the 212 .be IDs have a 5.0.0 successor, so 204 of 345 requirements (59%) get a CWE. Matching those CWEs against the "List of Mapped CWEs" on each Top 10:2025 category page, 162 requirements (47%) land in a category, and 42 have a CWE that no category lists. More than half of ASVS 5.0.0 has no route to the Top 10 at all, including 7.2.3 and 7.2.4.

The ones that do land show why OWASP gave up on the column. 3.4.4 (nosniff) maps to CWE-116, Improper Encoding or Escaping of Output, and so to A05 Injection. 3.4.1 (HSTS) maps to CWE-523, Unprotected Transport of Credentials, and so to A04 Cryptographic Failures. 3.4.6 (frame-ancestors) maps to CWE-1021 and so to A06 Insecure Design. None of these is wrong as a CWE, but a dashboard built on them would say "our HSTS test covers cryptographic failures," which isn't a claim anyone should sign.

If you need the mapping anyway, for a questionnaire or a report, build it and label it. Call it "unofficial, derived from OWASP's archived v5.0.be CWE export via the official be-to-5.0.0 mapping, at commit X," keep it in a separate file from the lock, and never use it to decide scope. Scope comes from your threat model, which is part 3 of this series.

Pin by digest, tag by full ID, and budget for review

Pin ASVS 5.0.0 by digest, not by name. Vendor the flat JSON from the v5.0.0_release assets, record its SHA-256, and fail the build if it changes. Don't build on the bleeding-edge assets: they're labeled for preview only, and today they're identical anyway.

Use the fully qualified ID everywhere. v5.0.0-3.4.1 in test tags, review records, tickets and reports. A bare 3.4.1 is a bug, even in conversation, because in 4.0.3 it meant a different requirement.

Write down the scope before writing tests. Pick a level and the chapters that apply, and record every exclusion with a reason. The Assessment chapter says a verification report should state scope "from the perspective of what was included" and that non-applicable requirements "must be noted." The lock's not-applicable records are that note.

Start with V3 if you have a frontend. Twenty of its 31 requirements are HTTP probes. Probe at least one path per response producer, including error handlers and the CDN, because that's where my first run failed.

Migrate 4.x tests with both mapping files. Re-review everything except the 10 pairs the reverse file marks as a bare move. Budget for it: in a full 4.0.3 mapping that's 256 pairs, and the forward file alone would have suggested 84 needed only renumbering.

Treat documentation requirements as code. Put them in the repository, give each an owner and a review date, and have CI check that they exist and are fresh. Don't pretend CI checks that they're right.

Keep any Top 10 mapping out of the compliance path. Generate it if you're asked, label it unofficial, and don't let it decide what you test.

What we don't know

When 5.0.1 or 5.1 will ship. The v5.0.1 milestone's due date passed in May 2026 with no issues assigned, and the change-control tags in CONTRIBUTING.md haven't been used on a single requirement yet. Nothing I found gives a date for either release. It's also unclear how the proposed 3.2.2 rewording in #3224 would be tagged: it replaces the examples rather than the goal, which could be read as [P:WORDING] or as a change of meaning. The first tagged pull request on that issue would settle it.

Why the forward mapping file under-reports modifications. 73 of the 84 old requirements it marks as a bare MOVED TO have targets the reverse file marks MODIFIED or GRAMMAR. Since the forward file uses MODIFIED elsewhere, a convention of tracking only location seems unlikely, but it could still be one, or an omission. The README doesn't say, and I haven't asked the project. Until it's clarified, trust the reverse file for "did the text change."

What the Changes page counts as "286 requirements". My reading, that it includes the eight placeholder rows of the 4.0.3 CSV, fits every number on the page and in the mapping files, but OWASP doesn't state it.

When the CycloneDX fix will reach a stable release. The corrected export exists only in the bleeding-edge build. Whether OWASP will re-issue the 5.0.0 assets or wait for the next release isn't recorded anywhere I found.

Whether a CRE mapping for 5.0 is coming. OpenCRE still links only 4.0.3 requirements, almost 17 months after the Changes page said a CRE mapping was the aim. With it, an ASVS-to-Top 10 path through CRE might be possible; without it, every team builds its own.

How much of ASVS real teams automate. My split of V3 and V7, and the chapter table, are one reader's judgment from the requirement texts and a small demo. I haven't found a published dataset of ASVS verification methods across real codebases, or a measurement of how often tagged tests drift from the requirement they cite. Either would be worth more than another opinion, including mine.

References

  1. OWASP ASVS releases. OWASP. Accessed .
  2. OWASP Application Security Verification Standard 5.0.0 (release). OWASP. Accessed .
  3. OWASP Application Security Verification Standard 4.0.3 (release). OWASP. Accessed .
  4. ASVS 5.0.0 source, English chapters. OWASP. Accessed .
  5. ASVS 5.0.0 Preface. OWASP. Accessed .
  6. What is the ASVS? (5.0.0). OWASP. Accessed .
  7. Assessment and Certification (5.0.0). OWASP. Accessed .
  8. Changes Compared to v4.x (5.0.0). OWASP. Accessed .
  9. V3 Web Frontend Security (5.0.0). OWASP. Accessed .
  10. V7 Session Management (5.0.0). OWASP. Accessed .
  11. ASVS mapping files README. OWASP. Accessed .
  12. mapping_v4.0.3_to_v5.0.0.yml. OWASP. Accessed .
  13. mapping_v5.0.0_to_v4.0.3.yml. OWASP. Accessed .
  14. mapping_v5.0.be_to_v5.0.0.yml. OWASP. Accessed .
  15. v5.0.be_cwe_mapping.json. OWASP. Accessed .
  16. Commit 817d521: mapping correction (#3176). OWASP. Accessed .
  17. OWASP Application Security Verification Standard project page. OWASP. Accessed .
  18. ASVS milestone v5.0.1. OWASP. Accessed .
  19. Issue #3224: Clarification: 3.2.2 Incompatible with Modern SPA Framework Practices. OWASP. Accessed .
  20. Issue #3305: v5.0.0: 6.5.7 conflict with NIST SP 800-63B-4. OWASP. Accessed .
  21. Pull request #3336: Enhance CONTRIBUTING.md with change control details. OWASP. Accessed .
  22. ASVS CONTRIBUTING.md: release strategy and change control. OWASP. Accessed .
  23. Issue #3344: V4.3.3-derived requirement accidentally deleted, mapping is stale. OWASP. Accessed .
  24. Pull request #3373: Fix stale v4.0.3-4.3.3 <-> v5.0.0-13.2.4 mapping. OWASP. Accessed .
  25. Issue #3198: Broken levels in CycloneDX output for ASVS v5. OWASP. Accessed .
  26. Issue #3354: ASVS CycloneDX Export is Invalid. OWASP. Accessed .
  27. Pull request #3355: Corrections to CycloneDX Export. OWASP. Accessed .
  28. CycloneDX Specification Overview. OWASP CycloneDX. Accessed .
  29. CycloneDX 1.6 JSON schema. OWASP CycloneDX. Accessed .
  30. Introduction - OWASP Top 10:2025. OWASP. Accessed .
  31. A04:2025 Cryptographic Failures. OWASP. Accessed .
  32. A05:2025 Injection. OWASP. Accessed .
  33. A06:2025 Insecure Design. OWASP. Accessed .
  34. CWE-116: Improper Encoding or Escaping of Output. MITRE. Accessed .
  35. CWE-523: Unprotected Transport of Credentials. MITRE. Accessed .
  36. OpenCRE REST API: standard ASVS. OWASP OpenCRE. Accessed .
  37. Content Security Policy Level 3 - W3C Working Draft. W3C. Accessed .
  38. Set-Cookie header - cookie prefixes. MDN. Accessed .
  39. browser-compat-data: http/headers/Set-Cookie.json. MDN. Accessed .
  40. NIST SP 800-63B-4, Digital Identity Guidelines: Authentication and Authenticator Management. NIST. Accessed .
  41. Playwright - Annotations: tag tests. Microsoft. Accessed .
  42. finalhandler v2.1.1 index.js. pillarjs. Accessed .
  43. actions/checkout releases. GitHub. Accessed .
  44. actions/setup-node releases. GitHub. Accessed .

Found this useful? Pass it on.

Set in Archivo on a twelve-column grid. Built with Lit web components and rendered to static HTML.

© 2026 Oleg Chursin
Brooklyn, New York