Skip to content

OWASP ASVS level 2 ​

What this page covers

Every choice of --Persistence, --Auth, --IncludeTests and --Aspire: a label says which options a part is for. The copy in your app's docs/ folder has only the parts for yours. ApiHost stands for your app's name.

How ApiHost measures up to the OWASP Application Security Verification Standard 5.0.0 at level 2, the level the ASVS recommends for most applications that handle personal data. It covers every level 1 and level 2 requirement, in the standard's order, and says whether the app meets it as it comes, what's left to you, and why. Security describes the same protections by feature.

This is a review of the template, not a certificate for your app: what you build on it, and how you deploy it, is part of what an assessor checks. Use it as a starting point for your own.

StatusMeaning
MetThe app does it as it comes.
PartlyMet for what the app has, with a gap that's described.
YoursIt depends on your deployment, your organisation or the features you add; what to do is described.
N/AThe app has no such feature (LDAP, GraphQL, WebRTC...). It applies once you add one.

Reviewed for v0.10.0 (November 2026), against ASVS 5.0.0.

V1 Encoding and Sanitization ​

#RequirementStatusHow
1.1.1Decode input once, before validationMetASP.NET Core decodes URLs and JSON once, before binding and validation; the app decodes nothing again.
1.1.2Encode output as the last step, or let the interpreter do itMetReact encodes text when it renders; System.Text.Json encodes JSON; queries are parameterised.
1.2.1Output encoding for the context (HTML, attributes, headers)MetReact escapes text and attributes; the server sends JSON, not HTML; header values come from the framework's typed APIs.
With organisations 1.2.2Encode untrusted data in URLs; only safe protocolsMetThe client builds URLs with encodeURIComponent. Webhook URLs must be https (and public) in production.
Without organisations 1.2.2Encode untrusted data in URLs; only safe protocolsMetThe client builds URLs with encodeURIComponent.
1.2.3Encode output when building JavaScript or JSONMetJSON is written by System.Text.Json. The only inline scripts are the build's own, allowed by hash.
1.2.4Parameterised database queriesMetMarten's LINQ and EF Core parameterise every query; there's no SQL built from strings.
1.2.5No OS command injectionMetThe app runs no commands.
1.2.6No LDAP injectionN/ANo LDAP.
1.2.7No XPath injectionN/ANo XPath.
1.2.8LaTeX processors locked downN/ANo LaTeX.
1.2.9Escape special characters in regular expressionsMetNo regular expression is built from input.
1.3.1Sanitise HTML from WYSIWYG editorsN/AThere's no rich-text input; text is shown as text. If you add an editor, sanitise its HTML on the server (for example with HtmlSanitizer, MIT).
1.3.2No eval() or dynamic code executionMetNone in the client or the server. Wolverine's code is generated at publish time, not from input; the Content-Security-Policy allows no eval.
1.3.3Sanitise data passed to dangerous contextsMetInput is validated (FluentValidation) and limited in length before it's stored or sent anywhere.
With accounts 1.3.4Sanitise user-supplied SVGMetPictures must be PNG, JPEG or WebP by their bytes, so an SVG is refused. Attachments of any type, SVG included, are only ever downloaded as files, never shown as pages (file storage).
Without accounts 1.3.4Sanitise user-supplied SVGMetAttachments of any type, SVG included, are only ever downloaded as files, never shown as pages (file storage).
1.3.5Sanitise Markdown, CSS, XSL and similarN/ANo user-supplied templates or stylesheets.
With organisations 1.3.6Protect against SSRFMetThe app calls fixed services (Stripe, Have I Been Pwned, Google, GitHub, file storage). Webhooks, the only addresses users choose, refuse private, link-local and loopback addresses after DNS, in production, and never follow redirects (integrations).
With accounts, without organisations 1.3.6Protect against SSRFMetThe app calls fixed services only: Have I Been Pwned, Google, GitHub and file storage. Users can't give it addresses to call.
Without accounts 1.3.6Protect against SSRFMetThe app calls only its file storage, at a configured address. Users can't give it addresses to call.
With accounts 1.3.7No templates built from untrusted inputMetEmails are built from fixed templates with encoded values.
Without accounts 1.3.7No templates built from untrusted inputN/AThe app sends no email.
1.3.8No JNDI injectionN/A.NET has no JNDI.
1.3.9Sanitise content sent to memcacheN/ANo memcache.
1.3.10Sanitise format stringsMetC# interpolation and structured logging take values as arguments, never as format strings.
1.3.11Sanitise input passed to mail systemsMetMailKit builds messages: addresses are parsed and header values encoded, so input can't add headers or recipients.
1.4.1Memory-safe strings and copiesMet.NET and JavaScript are memory safe; the app has no unsafe code.
1.4.2Prevent integer overflowsMetNumbers from requests are range-checked by validators (page sizes, limits, sizes).
1.4.3Release memory, no dangling pointersMetManaged memory.
1.5.1XML parsers with external entities offMetThe app parses no XML from users; .NET's parsers don't resolve external entities by default.
1.5.2Safe deserialisationMetSystem.Text.Json into fixed types; no type names from input. Wolverine and Marten read only what the app wrote.

V2 Validation and Business Logic ​

#RequirementStatusHow
2.1.1Document input validation rulesMetEach request's validator is the rule, next to its endpoint (for example CreateTodoValidator); the reference lists the endpoints.
2.1.2Document checks across combined fieldsYoursThe template's requests have few related fields; document your own as you add them.
With organisations 2.1.3Document business limits, per user and overallMetRate limits (security), upload sizes (file storage) and plan limits are documented with their settings.
With accounts, without organisations 2.1.3Document business limits, per user and overallMetRate limits (security) and upload sizes (file storage) are documented with their settings.
Without accounts 2.1.3Document business limits, per user and overallMetUpload sizes and counts are documented with their settings (file storage).
2.2.1Validate all input against expectationsMetEvery request has a validator or typed binding; a query value that doesn't parse answers 400 (RejectUnparseableQueryValues).
2.2.2Validate on the server, not only the clientMetThe API validates everything; the client's checks are only for convenience.
2.2.3Combinations of related fields are reasonableMetValidators check related fields together where they exist (for example a due date with a reminder).
With accounts 2.3.1Steps of a flow in order, none skippedMetMulti-step flows carry a server-issued ticket from the step before: two-factor sign-in, linking Google or GitHub, passkey ceremonies, uploads (an encrypted upload token).
Without accounts 2.3.1Steps of a flow in order, none skippedMetUploads carry a server-issued, encrypted upload token from the step before.
With organisations 2.3.2Business limits enforced as documentedMetPlan limits, invitation limits and upload limits are checked on the server.
With accounts, without organisations 2.3.2Business limits enforced as documentedMetInvitation and upload limits are checked on the server.
Without accounts 2.3.2Business limits enforced as documentedMetUpload limits are checked on the server.
2.3.3Transactions: all or nothingMetEach endpoint and handler commits its changes and the messages it sends in one transaction (Wolverine's outbox).
2.3.4Locking for limited resourcesPartlyMarten's and EF Core's optimistic concurrency stop lost updates where it matters (event streams). Limits such as a plan's seats are checked before the change, so two requests at the same instant could both pass; lock or re-check in the transaction if a limit must never be exceeded.
With organisations 2.4.1Anti-automation against excessive callsPartlyRate limits on sign-in, sign-up, email sending, invitations, picture uploads and API keys; plan limits on data. Other endpoints have none: add a limiter (AddRateLimiter) to any feature that's costly or could be used to fill your storage.
With accounts, without organisations 2.4.1Anti-automation against excessive callsPartlyRate limits on sign-in, sign-up, email sending and picture uploads. Other endpoints have none: add a limiter (AddRateLimiter) to any feature that's costly or could be used to fill your storage.
Without accounts 2.4.1Anti-automation against excessive callsPartlyUpload sizes and counts are limited, but there are no rate limits: add a limiter (AddRateLimiter) to any feature that's costly or could be used to fill your storage, and limit requests per address at the proxy.

V3 Web Frontend Security ​

#RequirementStatusHow
3.2.1Responses aren't rendered in the wrong contextMetAPI responses are JSON with nosniff; downloads come as attachments and, from local storage, with a sandboxing Content-Security-Policy.
3.2.2Text shown with safe rendering functionsMetReact renders text with textContent; no dangerouslySetInnerHTML on data.
With accounts 3.3.1Cookies Secure, with a __Secure- or __Host- prefixMetThe app's own cookies are Secure and named __Secure-... over HTTPS (Security/SecureCookies.cs). Not the consent cookie, which the browser sets and only records a choice, nor ASP.NET Core's short-lived correlation cookies during Google or GitHub sign-in.
Without accounts 3.3.1Cookies Secure, with a __Secure- or __Host- prefixMetThe app sets no cookies of its own. The consent cookie (with analytics on) only records a choice, and is set by the browser.
With accounts 3.3.2SameSite set for each cookie's purposeMetThe refresh token's cookie is Strict; the known-device cookie Lax, as Google and GitHub send people back to sign in.
Without accounts 3.3.2SameSite set for each cookie's purposeN/ANo cookies of the app's own.
With accounts 3.3.3__Host- prefix unless sharedPartly__Secure- rather than __Host-, which requires Path=/: the refresh token's cookie is kept to /api so it isn't sent with every page, script and picture, nor through a CDN. Host the app on a hostname of its own (3.5.4) so no sibling site can set cookies for it.
Without accounts 3.3.3__Host- prefix unless sharedN/ANo cookies of the app's own.
With accounts 3.3.4Session cookies HttpOnly, set only by Set-CookieMetThe refresh token is HttpOnly and never in a response body for browsers; the access token is kept in memory, not in a cookie.
Without accounts 3.3.4Session cookies HttpOnly, set only by Set-CookieN/ANo sessions.
3.4.1HSTS on every response, a year, subdomains includedMetOutside Development: a year, with includeSubDomains (Program.cs). Serve every subdomain over HTTPS before going live.
3.4.2CORS origins fixed or allow-listedMetNo CORS: the API answers no cross-origin requests from browsers.
3.4.3Content-Security-Policy with object-src 'none', base-uri 'none', allow-list or hashesMetScripts from the app's origin and the build's inline scripts by hash; object-src 'none', base-uri 'none', frame-ancestors 'none' (Security/SecurityHeaders.cs).
3.4.4X-Content-Type-Options: nosniff everywhereMetOn every response.
3.4.5Referrer policyMetstrict-origin-when-cross-origin: other sites see the origin, never the path or query.
3.4.6frame-ancestors on every responseMetframe-ancestors 'none', and X-Frame-Options: DENY for older browsers.
With accounts 3.5.1CSRF protection without relying on CORS preflightMetAPI calls carry the access token in the Authorization header, which another site can't send; the refresh cookie is only read with a custom header (X-Refresh-Token-Cookie).
Without accounts 3.5.1CSRF protection without relying on CORS preflightMetThe app has no sessions or cookies a forged request could ride on: every visitor shares the same data.
3.5.2Requests can't avoid a preflightMetThe cookie-reading endpoints need the custom header, which always triggers a preflight, and the API allows none.
With accounts 3.5.3Sensitive actions use POST, PUT, PATCH or DELETEMetEvery change is a POST, PUT or DELETE; links in emails open a page that POSTs.
Without accounts 3.5.3Sensitive actions use POST, PUT, PATCH or DELETEMetEvery change is a POST, PUT or DELETE.
3.5.4Separate applications on separate hostnamesYoursGive the app a hostname of its own (app.example.com), not a path beside other sites. With S3 or Azure, files come from the store's own hostname.
With accounts 3.5.5postMessage messages checkedMetThe client uses no postMessage across windows; tabs share sign-in state through a BroadcastChannel, which only the same origin can use.
Without accounts 3.5.5postMessage messages checkedMetThe client uses no postMessage.
3.7.1Only supported client-side technologiesMetReact and standard web APIs; no plugins.
With organisations 3.7.2Redirects to other hosts only from an allow-listMetThe only redirects off the app are to Google, GitHub and Stripe, with addresses the server builds.
With accounts, without organisations 3.7.2Redirects to other hosts only from an allow-listMetThe only redirects off the app are to Google and GitHub, with addresses the server builds.
Without accounts 3.7.2Redirects to other hosts only from an allow-listMetThe app doesn't redirect to other hosts.

V4 API and Web Service ​

#RequirementStatusHow
4.1.1Content-Type with charset matches the bodyMetapplication/json; charset=utf-8 and application/problem+json; static files by extension.
4.1.2Only user-facing pages redirect HTTP to HTTPSYoursThe reverse proxy (Caddy in deploy/) redirects every HTTP request. To refuse rather than redirect API calls over HTTP, answer /api on port 80 with an error in the proxy.
4.1.3Headers set by a proxy can't be forgedMetWith ASPNETCORE_FORWARDEDHEADERS_ENABLED, the app takes the client's address from the last proxy only, and Caddy replaces any X-Forwarded-For the client sent. Behind another proxy, check it does the same.
4.2.1Message boundaries determined consistently (no smuggling)MetKestrel and Caddy follow the HTTP specifications.
4.3.1GraphQL query limitsN/ANo GraphQL.
4.3.2GraphQL introspection off in productionN/ANo GraphQL.
4.4.1WebSockets over TLSMetSignalR uses the page's scheme: wss in production.
With accounts 4.4.2Check Origin on the WebSocket handshakePartlyThe hub doesn't check Origin. A page from another site can't use it as someone, though: the hub only accepts an access token, which that page doesn't have (no cookie is involved).
Without accounts 4.4.2Check Origin on the WebSocket handshakePartlyThe hub doesn't check Origin. With no accounts, it only sends what any visitor can see.
With accounts 4.4.3Dedicated WebSocket tokens follow session rulesMetThe hub uses the same short-lived access tokens, and closes connections when they expire.
Without accounts 4.4.3Dedicated WebSocket tokens follow session rulesN/ANo sessions.
With accounts 4.4.4WebSocket tokens come from the HTTPS sessionMetThe access token comes from signing in over HTTPS.
Without accounts 4.4.4WebSocket tokens come from the HTTPS sessionN/ANo sessions.

V5 File Handling ​

#RequirementStatusHow
With accounts 5.1.1Document file types, sizes, and how files are made safeMetFile storage: pictures (PNG, JPEG, WebP, 512 KB) and attachments (size and count limits, any type, always downloaded).
Without accounts 5.1.1Document file types, sizes, and how files are made safeMetFile storage: attachments (size and count limits, any type, always downloaded).
With accounts 5.2.1Only files of a size the app can handleMetPictures are limited to 512 KB and 1024 pixels a side; attachments to Attachments:MaxBytes, checked after the upload too.
Without accounts 5.2.1Only files of a size the app can handleMetAttachments are limited by Attachments:MaxBytes, checked after the upload too.
With accounts 5.2.2Extension and content match the expected typePartlyPictures are checked by their bytes and decoded. Attachments accept any type, as they're only stored and downloaded: if a feature of yours processes files, check their type by content.
Without accounts 5.2.2Extension and content match the expected typePartlyAttachments accept any type, as they're only stored and downloaded: if a feature of yours processes files, check their type by content.
5.2.3Compressed files checked before unpackingN/AThe app unpacks nothing.
5.3.1Uploads never run as codeMetFiles go to a store (a folder outside wwwroot, S3 or Azure), never executed, and are served as attachments.
5.3.2File paths from trusted dataMetStorage keys are generated by the app; a key can't leave the storage folder.
5.4.1Ignore user-supplied file names; set Content-DispositionMetFiles are stored under generated keys; downloads name the file in Content-Disposition.
5.4.2File names encoded in headers (RFC 6266)MetFileDownloads.AttachmentHeader uses filename* encoding.
5.4.3Antivirus scanning of untrusted filesYoursNo scanning. If files are shared between people, scan them after upload (ClamAV, or your storage provider's malware scanning) before making them available.

With accounts

V6 Authentication ​

#RequirementStatusHow
6.1.1Document rate limits, anti-automation and lockoutMetAccounts and security: per-address rate limits, a per-account lockout of 15 minutes, which a password reset lifts so an attacker can't keep someone out.
6.1.2Document context-specific words not allowed in passwordsMetThe email, the app's name and Accounts:PasswordBlockedWords (accounts).
6.1.3Document every way to sign in, with equal strengthMetAccounts: password, passkey, Google and GitHub, each with two-factor where it applies.
6.2.1Passwords of at least 8 charactersMet8 or more.
6.2.2Users can change their passwordMetSettings → Security.
6.2.3Changing a password needs the current oneMetPOST /api/account/password checks it.
6.2.4New passwords checked against the top 3,000MetThe 10,000 most common passwords of 8 characters or more (Identity/CommonPasswords.cs).
6.2.5No composition rulesMetAny characters; no upper case, digit or symbol rules.
6.2.6Password fields use type=passwordMetEvery password field.
6.2.7Paste and password managers allowedMetNothing blocks paste; fields have autocomplete set for password managers.
6.2.8Passwords checked exactly as typedMetNo trimming, truncation or case changes.
6.2.9Passwords of 64 characters or more allowedMetNo maximum beyond the request's size.
6.2.10No periodic password changesMetPasswords never expire.
6.2.11Context-specific words refusedMetCommonPasswordValidator.
6.2.12New passwords checked against breached passwordsPartlyWith Accounts:RejectBreachedPasswords=true, through Have I Been Pwned without sending the password. Off by default because it calls an outside service: turn it on in production.
6.3.1Defences against credential stuffing and brute forceMetRate limits per address, lockout per account, emails about new devices and lockouts.
6.3.2No default accountsMetThe demo user exists in Development only; admins come from Accounts:AdminEmails once confirmed.
6.3.3Multi-factor authentication, or a combination of factorsPartlyOffered to everyone (authenticator apps and passkeys), and can be required of admins (Accounts:RequireTwoFactorForAdmins) and, with organisations, by an organisation of its members. Not required of every user: whether to require it is your decision, to document.
6.3.4No undocumented ways to sign inMetThe ways in accounts are all there is; API keys (with organisations) are separate credentials for programs.
6.4.1Initial passwords and activation codes random, short-livedMetInvitations and confirmations are links with signed, single-use tokens that expire (a week for invitations); there are no initial passwords.
6.4.2No password hints or secret questionsMetNone.
6.4.3Password reset doesn't bypass multi-factorMetA reset sets the password only; signing in afterwards still asks for the code.
6.4.4Lost second factor: identity proven againYoursRecovery codes cover a lost phone. Without them, an admin can turn two-factor off (back office); decide how admins confirm who's asking before they do.
6.5.1Codes from authenticator apps and recovery codes work onceMetRecovery codes are used up; an authenticator code is refused a second time (ApplicationUserManager, remembered per instance).
6.5.2Lookup secrets stored hashedMetRecovery codes have 125 random bits and are stored as SHA-256 hashes.
6.5.3Secrets and seeds from a CSPRNGMetAuthenticator keys, recovery codes and tokens come from RandomNumberGenerator.
6.5.4Codes with at least 20 bits of entropyMetSix-digit codes; recovery codes have 125 bits.
6.5.5Defined lifetimes; TOTP of 30 secondsMet30-second codes (accepted a step either side, for clocks that drift); the step between password and code expires after 5 minutes.
6.6.1SMS and phone codesN/ANo SMS or phone codes.
6.6.2Out-of-band codes bound to their requestMetEmail links are tied to the user and their purpose, and stop working once used.
6.6.3Out-of-band codes rate limitedMetEmail links carry long signed tokens, and the endpoints that use them are rate limited.
6.8.1Identities from several providers can't be confusedMetExternal logins are keyed by provider and the provider's user ID; an email is only linked once the provider has verified it.
6.8.2Signatures on authentication assertions validatedMetGoogle and GitHub sign-in use the authorisation code flow over TLS; ASP.NET Core's handlers validate what they receive.
6.8.3SAML assertions used onceN/ANo SAML.
6.8.4Strength and recency from the identity provider checkedMetGoogle and GitHub sign-ins are treated as one factor: with two-factor on, they also need a code.

V7 Session Management ​

#RequirementStatusHow
7.1.1Document inactivity and absolute timeouts, and deviations from NISTMetA session ends after Jwt:RefreshTokenLifetimeDays unused (14) and at most Jwt:SessionLifetimeDays after sign-in (30), NIST SP 800-63B's limit for AAL1. AAL2 asks for re-authentication every 24 hours: shorten both if your app needs that.
7.1.2Document how many sessions an account may haveMetAny number, one per device; all are listed in Settings, where any can be ended.
7.1.3Document federated session lifetimesMetSigning in with Google or GitHub starts an app session like any other; signing out of Google or GitHub doesn't end it.
7.2.1Tokens verified on the serverMetEvery request's access token is validated by the API.
7.2.2Dynamically generated session tokens, not static keysMetAccess and refresh tokens are issued at sign-in; API keys (with organisations) are for programs.
7.2.3Reference tokens random with 128 bitsMetRefresh tokens have 512 random bits and are stored as hashes.
7.2.4A new token at every sign-inMetEvery sign-in starts a new session with new tokens.
7.3.1Inactivity timeoutMetJwt:RefreshTokenLifetimeDays.
7.3.2Absolute session lifetimeMetJwt:SessionLifetimeDays.
7.4.1Terminated sessions can't be usedMetSigning out revokes the refresh token; the access token expires within Jwt:AccessTokenLifetimeMinutes (15).
7.4.2Sessions end when an account is disabled or deletedMetLocking or deleting an account revokes its refresh tokens, and a locked account can't refresh.
7.4.3Option to end other sessions after changing a factorMetChanging or resetting the password ends every other session; Settings can end the rest at any time.
7.4.4Sign out visible on every signed-in pageMetIn the header's account menu.
7.4.5Admins can end a user's sessionsMetThe back office's "End sessions".
7.5.1Re-authentication before changing what recovers the accountMetChanging the email needs the password and, with two-factor on, a code. Turning two-factor off needs a code.
7.5.2Users can view and end their sessionsPartlySettings lists sessions and ends any or all. It doesn't ask for the password again first.
7.6.1Federated session lifetimes behave as documentedMetSee 7.1.3.
7.6.2A session needs the user's actionMetSessions start only from a sign-in the user makes.

V8 Authorization ​

#RequirementStatusHow
With organisations 8.1.1Document function and data access rulesMetAccounts (roles, organisation roles) and the reference, which lists who can call each endpoint.
Without organisations 8.1.1Document function and data access rulesMetAccounts (roles) and the reference, which lists who can call each endpoint.
8.1.2Document field-level access rulesMetRequests are records with only the fields a caller may set; responses list only what the caller may see.
8.2.1Function access needs explicit permissionMetEndpoints require sign-in unless marked public; admin endpoints need the Admin role. EndpointSecurityTests fails on an endpoint that's neither.
With organisations 8.2.2Data access only to its owner (no IDOR)MetData belongs to an organisation and is filtered by multi-tenancy in the data layer; someone else's records answer 404.
Without organisations 8.2.2Data access only to its owner (no IDOR)MetData belongs to a user and is loaded by owner; someone else's records answer 404.
8.2.3Field-level accessMetNo endpoint binds a whole entity, so a request can't set fields it shouldn't (see 15.3.3).
8.3.1Authorisation on the serverMetThe client only hides what the API refuses anyway.
With organisations 8.4.1Tenants can't affect each otherMetMarten's multi-tenancy or EF Core's tenant filter, from the token's organisation, and checked membership on every request.
Without organisations 8.4.1Tenants can't affect each otherMetEach user's data is separate (see 8.2.2).

V9 Self-contained Tokens ​

#RequirementStatusHow
9.1.1Tokens validated by signatureMetAccess tokens are JWTs checked for signature, issuer, audience and lifetime.
9.1.2Only allow-listed algorithmsMetHS256 only (ValidAlgorithms).
9.1.3Keys only from trusted configurationMetOne key from Jwt:SigningKey; headers such as jku and jwk are ignored. The app won't start with a short or development key outside Development.
9.2.1exp and nbf checkedMetWith 30 seconds' clock skew.
9.2.2Token type checkedMetThe app issues one kind of JWT, the access token; other tickets are Data Protection payloads with their own purposes.
9.2.3Audience checkedMetJwt:Audience.
9.2.4Audience restricted when one key signs for several audiencesMetOne key, one audience. Give each app its own key.

V10 OAuth and OIDC ​

The app is an OAuth client of Google and GitHub, and the API is a resource server for its own tokens. It isn't an authorisation server or an OpenID provider, so 10.4, 10.6 and 10.7 don't apply.

#RequirementStatusHow
10.1.1Tokens only sent where they're neededMetGoogle's and GitHub's tokens stay on the server and aren't kept; the browser gets only the app's own tokens.
10.1.2Responses tied to the user agent's transaction (state, PKCE)MetASP.NET Core's handlers use state with a correlation cookie, and PKCE where the provider supports it.
10.2.1CSRF protection on the code flowMetAs 10.1.2.
10.2.2Mix-up defence with several authorisation serversMetEach provider has its own callback path and handler.
10.3.1Resource server checks the audienceMetSee 9.2.3.
With organisations 10.3.2Authorisation from the token's claimsMetUser, roles and organisation come from the token's claims.
Without organisations 10.3.2Authorisation from the token's claimsMetUser, roles come from the token's claims.
10.3.3Users identified by claims that can't be reassignedMetsub is the user's ID, never reused.
10.3.4Strength and recency checked when requiredMetWhere an action needs more (changing the email, deleting the account), the API asks for the password and code again rather than trusting the token's age.
10.4.1 – 10.4.11Authorisation server requirementsN/AThe app isn't an authorisation server.
10.5.1ID token replay prevented (nonce)MetGoogle sign-in uses ASP.NET Core's OAuth handler; the identity comes from the provider's user info over TLS, not from an ID token.
10.5.2Users identified by subMetBy the provider's user ID.
10.5.3Issuer metadata matchesN/ANo discovery documents are used; the providers' addresses are fixed.
10.5.4ID token audience checkedN/ASee 10.5.1.
10.5.5Back-channel logout tokens checkedN/ANo back-channel logout.
10.6.1, 10.6.2OpenID provider requirementsN/AThe app isn't an OpenID provider.
10.7.1 – 10.7.3Consent managementN/AThe app isn't an authorisation server.

Without accounts

V6 to V10: Authentication, sessions, authorisation and tokens ​

This app has no accounts, so there's no authentication, session or token to assess, and every visitor shares the same data. These chapters apply once you add sign-in; the template's --Auth identity and --Auth saas options meet them as their versions of this page describe.

V11 Cryptography ​

#RequirementStatusHow
With accounts 11.1.1Key management policyYoursThe app's keys: Jwt:SigningKey (rotate it as described), ASP.NET Core Data Protection's keys (in PostgreSQL, rotated every 90 days by the framework), and your providers' secrets. Write down who holds them and how they're replaced.
Without accounts 11.1.1Key management policyYoursThe app's keys: ASP.NET Core Data Protection's (rotated every 90 days by the framework; kept in the container, so a restart makes new ones and only short-lived signed URLs are lost), and your providers' secrets. Write down who holds them and how they're replaced.
11.1.2Cryptographic inventoryMetBelow.
11.2.1Industry-validated implementationsMet.NET's System.Security.Cryptography (the operating system's libraries) and ASP.NET Core Data Protection. No custom cryptography.
With accounts 11.2.2Crypto agilityMetData Protection rotates keys and algorithms; password hashes are upgraded by Identity on sign-in; the JWT key can be rotated.
Without accounts 11.2.2Crypto agilityMetData Protection rotates its keys and can change algorithms.
11.2.3At least 128 bits of securityMetSee the inventory.
11.3.1No ECB or weak paddingMetAES-256-CBC with HMAC-SHA256 (Data Protection's default).
11.3.2Approved ciphers and modesMetAs 11.3.1.
11.3.3Authenticated encryptionMetData Protection authenticates everything it encrypts.
11.4.1Approved hash functionsMetSHA-256 and HMAC-SHA256. SHA-1 is used only to look up Have I Been Pwned's index, not for security.
With accounts 11.4.2Passwords with an approved KDFMetIdentity's PBKDF2 with HMAC-SHA512, 100,000 iterations.
Without accounts 11.4.2Passwords with an approved KDFN/ANo passwords.
11.4.3Collision-resistant hashes of 256 bitsMetSHA-256.
11.4.4Keys derived from passwords use a KDFN/ANo keys are derived from passwords.
11.5.1Non-guessable values from a CSPRNG, 128 bitsMetTokens, keys and codes come from RandomNumberGenerator. IDs are GUIDs, which aren't secrets: access is checked, not assumed from an unguessable ID.
With accounts 11.6.1Approved public-key algorithmsMetPasskeys use the authenticator's keys (ES256, RS256), checked by Identity.
Without accounts 11.6.1Approved public-key algorithmsN/ANo public-key cryptography of the app's own.

The app's cryptography:

WhatAlgorithmKey
With accounts Access tokens (JWT)HMAC-SHA256Jwt:SigningKey, at least 256 bits
With accounts With organisations Refresh tokens, API keys, recovery codes, invitation tokens (stored)SHA-256 of 128+ random bitsNone
With accounts Without organisations Refresh tokens and recovery codes (stored)SHA-256 of 128+ random bitsNone
With accounts PasswordsPBKDF2-HMAC-SHA512, 100,000 iterations, 128-bit saltNone
With accounts With organisations Email links, two-factor tickets, passkey state, known devices, organisation secretsData Protection: AES-256-CBC + HMAC-SHA256Data Protection keys, in PostgreSQL
With accounts Without organisations Email links, two-factor tickets, passkey state, known devicesData Protection: AES-256-CBC + HMAC-SHA256Data Protection keys, in PostgreSQL
With accounts Authenticator codes (TOTP)HMAC-SHA1 (RFC 6238, as authenticator apps require)A 160-bit key per user
Signed file URLs (local storage), upload tokensData ProtectionData Protection keys
With organisations Webhook signaturesHMAC-SHA256A secret per endpoint
TLSTLS 1.2 and 1.3 (Caddy's defaults)Let's Encrypt certificates

V12 Secure Communication ​

#RequirementStatusHow
12.1.1Only TLS 1.2 and 1.3MetCaddy (deploy/) allows only TLS 1.2 and 1.3. Behind another proxy or load balancer, configure it the same way.
12.1.2Recommended cipher suitesMetCaddy's defaults.
12.1.3mTLS client certificates validatedN/ANo client certificates.
12.2.1TLS for every external connectionMetHTTPS redirection and HSTS; Caddy serves HTTPS only.
12.2.2Publicly trusted certificatesMetCaddy gets Let's Encrypt certificates.
With organisations 12.3.1TLS for every connection, in and outPartlyOutgoing calls (Stripe, Google, GitHub, Have I Been Pwned, S3, Azure, webhooks) use HTTPS. In deploy/, PostgreSQL is reached over Docker's private network without TLS: with a managed database, add SSL Mode=VerifyFull to the connection string. SMTP uses TLS when the server offers it: set Email:Smtp:Security to StartTls or SslOnConnect so it can't fall back.
With accounts, without organisations 12.3.1TLS for every connection, in and outPartlyOutgoing calls (Google, GitHub, Have I Been Pwned, S3, Azure) use HTTPS. In deploy/, PostgreSQL is reached over Docker's private network without TLS: with a managed database, add SSL Mode=VerifyFull to the connection string. SMTP uses TLS when the server offers it: set Email:Smtp:Security to StartTls or SslOnConnect so it can't fall back.
Without accounts 12.3.1TLS for every connection, in and outPartlyOutgoing calls (S3, Azure) use HTTPS. In deploy/, PostgreSQL is reached over Docker's private network without TLS: with a managed database, add SSL Mode=VerifyFull to the connection string.
12.3.2TLS clients validate certificatesMet.NET validates every certificate; the app turns none of that off.
12.3.3TLS between internal HTTP servicesN/AThe app is one service; the proxy reaches it over a private network.
12.3.4Internal certificates trusted explicitlyN/AAs 12.3.3.

V13 Configuration ​

#RequirementStatusHow
With organisations 13.1.1Document all communication needsMetDeployment lists the services the app uses and their settings; webhooks are the only addresses users choose.
Without organisations 13.1.1Document all communication needsMetDeployment lists the services the app uses and their settings; users can't give it addresses to call.
With accounts 13.2.1Backend connections authenticated, without unchanging shared credentialsYoursPostgreSQL and SMTP use passwords from configuration. Prefer your cloud's managed identities (Azure, AWS IAM) for the database and storage where you can.
Without accounts 13.2.1Backend connections authenticated, without unchanging shared credentialsYoursPostgreSQL uses a password from configuration. Prefer your cloud's managed identities (Azure, AWS IAM) for the database and storage where you can.
13.2.2Least privilege for backend accountsYoursThe app needs to create its tables at startup. Once deployed, you can run it with a database role that owns only its own schema.
With accounts 13.2.3No default credentialsMetdeploy/ makes you set every password; the app refuses the development signing key.
Without accounts 13.2.3No default credentialsMetdeploy/ makes you set every password.
With organisations 13.2.4Allow-list of outbound destinationsYoursThe app calls fixed hosts (see 13.1.1), plus webhook addresses, which must be public. To enforce it, restrict outbound traffic at the firewall.
Without organisations 13.2.4Allow-list of outbound destinationsYoursThe app calls fixed hosts (see 13.1.1). To enforce it, restrict outbound traffic at the firewall.
13.2.5Server allow-list for requests and loadsYoursAs 13.2.4.
13.3.1Secrets in a secrets manager, not in sourcePartlyNo secrets are in the source or the image: they come from environment variables (deploy/.env on the server) or user secrets in development. A secrets manager (your cloud's key vault) is better than a file on the server.
13.3.2Least privilege for secretsYoursLimit who can read deploy/.env or your key vault.
13.4.1No .git or source control metadata deployedMetThe container image holds only the published app.
13.4.2Debug modes off in productionMetDevelopment's exception page and code generation only run in Development; production loads pre-generated code.
13.4.3No directory listingsMetStatic files are served without directory browsing.
13.4.4No HTTP TRACEMetNo endpoint answers TRACE.
13.4.5Documentation and monitoring endpoints not exposed unless intendedPartlyThe OpenAPI document and /scalar only exist in Development. /health/live and /health/ready are public and say only "Healthy" or "Unhealthy"; hide them at the proxy if you'd rather.

V14 Data Protection ​

#RequirementStatusHow
With accounts 14.1.1Sensitive data identified and classifiedPartlyThe template's own: passwords, codes and tokens (secrets, stored hashed or encrypted), personal data (emails, names, pictures, user content), and files. Classify your app's data as you add it.
Without accounts 14.1.1Sensitive data identified and classifiedPartlyThe template's own: personal data (user content), and files. Classify your app's data as you add it.
14.1.2Protection requirements per levelYoursDecide them for your data: retention, encryption at rest, who can read logs.
With accounts 14.2.1No sensitive data in URLsPartlyTokens go in headers and bodies. The exceptions: SignalR's WebSocket takes the access token in the query string, as browsers can't set headers on one (short-lived, and OpenTelemetry redacts query strings); links in emails carry their token to a page that POSTs it; signed file URLs are short-lived.
Without accounts 14.2.1No sensitive data in URLsMetNothing sensitive goes in URLs; signed file URLs are short-lived.
14.2.2Sensitive data not cached by serversMetAPI responses are Cache-Control: no-store. Public pages and assets are cached; nothing personal is.
14.2.3Sensitive data not sent to trackersMetNo analytics unless you set Analytics:GoogleTagManagerId, and then only after consent. Don't put personal data in tags.
14.2.4Controls as documented for each levelYoursSee 14.1.2.
With accounts 14.3.1Client data cleared at sign-outMetSigning out deletes the refresh cookie and clears the access token and cached data from memory in every tab.
Without accounts 14.3.1Client data cleared at sign-outN/ANo sessions.
14.3.2Cache-Control: no-store for sensitive dataMetEvery API response, unless an endpoint sets its own (signed file downloads, privately, for minutes).
With accounts 14.3.3No sensitive data in browser storageMetlocalStorage holds only the theme and whether someone is signed in; the session is in an HttpOnly cookie.
Without accounts 14.3.3No sensitive data in browser storageMetlocalStorage holds only the theme.

V15 Secure Coding and Architecture ​

#RequirementStatusHow
15.1.1Remediation time frames for vulnerable componentsYoursDependabot opens update pull requests weekly. Decide and write down how fast you apply them: for example, critical within days, others within a month.
15.1.2Software bill of materialsYoursDirectory.Packages.props and the lock files list every package. To publish an SBOM, generate one in your build (dotnet CycloneDX, npm sbom).
With organisations 15.1.3Document costly functionality and its defencesMetUploads, emails, exports and webhooks run as durable background messages with retries; architecture describes them.
With accounts, without organisations 15.1.3Document costly functionality and its defencesMetUploads, emails and exports run as durable background messages with retries; architecture describes them.
Without accounts 15.1.3Document costly functionality and its defencesMetUploads and background work run as durable messages with retries; architecture describes them.
15.2.1Components within remediation time framesYoursSee 15.1.1. The template's CI fails on known vulnerabilities; run dotnet list package --vulnerable --include-transitive and npm audit in yours.
With accounts 15.2.2Defences for costly functionalityMetBackground queues, rate limits and size limits (see 2.4.1).
Without accounts 15.2.2Defences for costly functionalityMetBackground queues and size limits (see 2.4.1).
15.2.3No test code or samples in productionPartlyTests aren't published. The Todos are a sample feature: replace or remove them before going live, as adding a feature describes.
15.3.1Only needed fields returnedMetEndpoints return response records, never entities.
With organisations 15.3.2Outgoing calls don't follow redirectsMetWebhooks never follow redirects. Other calls go to fixed providers.
Without organisations 15.3.2Outgoing calls don't follow redirectsMetOther calls go to fixed providers.
15.3.3No mass assignmentMetRequests bind to records with only the settable fields.
With accounts 15.3.4Client address from trusted proxy headersMetSee 4.1.3; rate limits and logs use it.
Without accounts 15.3.4Client address from trusted proxy headersMetSee 4.1.3; logs use it.
15.3.5Strict types, no type jugglingMetC# and TypeScript (strict).
15.3.6No prototype pollutionMetThe client never merges untrusted objects into others.
15.3.7No HTTP parameter pollutionMetEach parameter has one source (route, query or body), set by the endpoint's signature.

V16 Security Logging and Error Handling ​

#RequirementStatusHow
16.1.1Log inventoryPartlyObservability: logs go to the console and, with OpenTelemetry configured, to your collector; security lists the security events. Retention and access are your logging system's.
16.2.1Who, what, when and where in each entryMetTimestamp, trace ID and request path on every entry; security events add the user and address.
16.2.2Synchronised clocks, UTCMetTimestamps are UTC; containers use the host's synchronised clock.
16.2.3Logs only go where documentedMetThe console and the OpenTelemetry exporter you configure.
16.2.4Logs in a common formatMetOpenTelemetry's log format, or the console.
With accounts 16.2.5Sensitive data logged according to its levelMetNo passwords, tokens or codes are logged; links with tokens are never stored or logged.
Without accounts 16.2.5Sensitive data logged according to its levelMetNothing secret is logged.
With accounts 16.3.1Authentication logged, success and failureMetSign-ins (user, session, method) and refused sign-in requests (Security/SecurityEvents.cs); Identity logs lockouts.
Without accounts 16.3.1Authentication logged, success and failureN/ANo authentication.
With accounts 16.3.2Failed authorisation loggedMetEvery 403 is logged with the user and address.
Without accounts 16.3.2Failed authorisation loggedMetEvery 403 is logged with the address.
With accounts 16.3.3Security events and bypass attempts loggedPartlyRefusals, rate limits and reused refresh tokens are logged. Validation failures (400) aren't, as they're mostly honest mistakes.
Without accounts 16.3.3Security events and bypass attempts loggedPartlyRefusals are logged. Validation failures (400) aren't, as they're mostly honest mistakes.
16.3.4Unexpected errors loggedMetUnhandled exceptions and failed messages are logged with their trace; failed messages are kept for the back office.
16.4.1Logs encoded against injectionMetStructured logging keeps values apart from the message.
16.4.2Logs protected from changesYoursYour log store's job.
16.4.3Logs sent to a separate systemYoursConfigure the OpenTelemetry exporter (observability) so logs leave the server.
16.5.1Generic error messagesMetProduction errors are ProblemDetails with a trace ID and no details.
With organisations 16.5.2Keeps working when external services failMetEmails, webhooks and other outside calls are durable messages with retries; Have I Been Pwned failing accepts the password.
With accounts, without organisations 16.5.2Keeps working when external services failMetEmails and other outside calls are durable messages with retries; Have I Been Pwned failing accepts the password.
Without accounts 16.5.2Keeps working when external services failMetOutside calls (file storage) are retried, as durable messages where they run in the background.
16.5.3Fails securelyMetFailures roll back the transaction; authorisation fails closed.

V17 WebRTC ​

#RequirementStatusHow
17.1.1 – 17.3.2TURN, media and signalling serversN/ANo WebRTC.

Documentation for v0.10.0. Released under the MIT licence.