From 8a1ea66eb4363436f335c8bc9d78e2ff7573c6c8 Mon Sep 17 00:00:00 2001 From: Mehul Sehgal Date: Wed, 18 Nov 2026 17:50:46 +0530 Subject: [PATCH 01/12] feat(audit): implement checkJwtSecrets rule detecting identical or default secrets --- backend/audit/checks/jwtSecrets.js | 90 ++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 backend/audit/checks/jwtSecrets.js diff --git a/backend/audit/checks/jwtSecrets.js b/backend/audit/checks/jwtSecrets.js new file mode 100644 index 0000000..e496b5d --- /dev/null +++ b/backend/audit/checks/jwtSecrets.js @@ -0,0 +1,90 @@ +// backend/audit/checks/jwtSecrets.js +'use strict'; + +const KNOWN_INSECURE_SECRETS = new Set([ + 'your-secret-key-change-in-production', + 'your-jwt-secret-key-change-in-production', + 'your-jwt-refresh-secret-key-change-in-production', + 'your-secret-key', + 'your-jwt-secret', + 'secret', + 'jwtsecret', + 'changeme', + '123456' +]); + +/** + * Check: distinct access and refresh JWT secrets (Issue #73). + * Flags when jwtSecret and jwtRefreshSecret are equal or left at their defaults. + */ +function checkJwtSecrets(config = {}, context = {}) { + const findings = []; + const jwtSecret = config.jwtSecret || process.env.JWT_SECRET; + const jwtRefreshSecret = config.jwtRefreshSecret || process.env.JWT_REFRESH_SECRET; + const isProduction = (context.env === 'production' || process.env.NODE_ENV === 'production'); + + // Check 1: Missing secrets + if (!jwtSecret) { + findings.push({ + id: 'jwt-secret-missing', + rule: 'distinct-jwt-secrets', + severity: isProduction ? 'error' : 'warn', + title: 'Missing access token JWT secret', + message: 'jwtSecret is not configured. A high-entropy random secret must be provided.', + remediation: 'Provide a strong random string via process.env.JWT_SECRET or config.jwtSecret.' + }); + } + + if (!jwtRefreshSecret) { + findings.push({ + id: 'jwt-refresh-secret-missing', + rule: 'distinct-jwt-secrets', + severity: isProduction ? 'error' : 'warn', + title: 'Missing refresh token JWT secret', + message: 'jwtRefreshSecret is not configured. Separate secrets must be used for access and refresh tokens.', + remediation: 'Provide a strong random string via process.env.JWT_REFRESH_SECRET or config.jwtRefreshSecret.' + }); + } + + // Check 2: Default or placeholder secrets + if (jwtSecret && KNOWN_INSECURE_SECRETS.has(jwtSecret.trim().toLowerCase())) { + findings.push({ + id: 'jwt-secret-default', + rule: 'distinct-jwt-secrets', + severity: isProduction ? 'error' : 'warn', + title: 'Default/insecure JWT secret in use', + message: `jwtSecret is using a known default placeholder ("${jwtSecret}").`, + remediation: 'Generate a high-entropy secret (e.g. node -e "console.log(crypto.randomBytes(32).toString(\'hex\'))").' + }); + } + + if (jwtRefreshSecret && KNOWN_INSECURE_SECRETS.has(jwtRefreshSecret.trim().toLowerCase())) { + findings.push({ + id: 'jwt-refresh-secret-default', + rule: 'distinct-jwt-secrets', + severity: isProduction ? 'error' : 'warn', + title: 'Default/insecure JWT refresh secret in use', + message: `jwtRefreshSecret is using a known default placeholder ("${jwtRefreshSecret}").`, + remediation: 'Generate a distinct high-entropy secret for refresh tokens.' + }); + } + + // Check 3: Reused / identical access and refresh secrets + if (jwtSecret && jwtRefreshSecret && jwtSecret === jwtRefreshSecret) { + findings.push({ + id: 'jwt-secrets-identical', + rule: 'distinct-jwt-secrets', + severity: isProduction ? 'error' : 'warn', + title: 'Access and refresh token JWT secrets are identical', + message: 'jwtSecret and jwtRefreshSecret share the same secret key. Compromising one compromises both token types.', + remediation: 'Use distinct, independent secret keys for access tokens and refresh tokens.' + }); + } + + return findings; +} + +module.exports = { + checkJwtSecrets, + KNOWN_INSECURE_SECRETS +}; From c21139b9aa540f5e58cc113256174520c0569a42 Mon Sep 17 00:00:00 2001 From: Mehul Sehgal Date: Wed, 18 Nov 2026 17:50:51 +0530 Subject: [PATCH 02/12] feat(audit): create core audit runner and checks registry --- backend/audit/index.js | 59 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 backend/audit/index.js diff --git a/backend/audit/index.js b/backend/audit/index.js new file mode 100644 index 0000000..169d6a7 --- /dev/null +++ b/backend/audit/index.js @@ -0,0 +1,59 @@ +// backend/audit/index.js +'use strict'; + +const { checkJwtSecrets } = require('./checks/jwtSecrets'); + +/** + * Registry of available audit checks. + */ +const CHECKS = [ + checkJwtSecrets +]; + +/** + * Runs security audit on a Dimsee configuration or running app instance. + * @param {Object} input - Dimsee configuration object or Express app with app.locals.authConfig + * @param {Object} [options] - Audit options + * @returns {Object} Audit report containing findings and summary + */ +function audit(input = {}, options = {}) { + // Support passing app instance or raw config + let config = input; + if (input && input.locals && input.locals.authConfig) { + config = input.locals.authConfig; + } + + const env = options.env || process.env.NODE_ENV || 'development'; + const findings = []; + + for (const check of CHECKS) { + const checkResult = check(config, { env, ...options }); + if (checkResult) { + if (Array.isArray(checkResult)) { + findings.push(...checkResult); + } else { + findings.push(checkResult); + } + } + } + + const passed = findings.every(f => f.severity !== 'error'); + const counts = { + error: findings.filter(f => f.severity === 'error').length, + warn: findings.filter(f => f.severity === 'warn').length, + info: findings.filter(f => f.severity === 'info').length + }; + + return { + passed, + counts, + findings, + timestamp: new Date().toISOString() + }; +} + +module.exports = { + audit, + CHECKS, + checkJwtSecrets +}; From 18bb471d14dc91d0f856a7306590ac2ab047ab01 Mon Sep 17 00:00:00 2001 From: Mehul Sehgal Date: Wed, 18 Nov 2026 17:50:55 +0530 Subject: [PATCH 03/12] feat(exports): export audit function from backend and root packages --- backend/index.js | 4 +++- index.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/index.js b/backend/index.js index e0b38ed..f1c54d4 100644 --- a/backend/index.js +++ b/backend/index.js @@ -110,4 +110,6 @@ const createAuthBackend = (config = {}) => { return app; }; -module.exports = { createAuthBackend, authMiddleware, User }; +const { audit } = require("./audit"); + +module.exports = { createAuthBackend, authMiddleware, User, audit }; diff --git a/index.js b/index.js index 75c4017..d7cbd3c 100644 --- a/index.js +++ b/index.js @@ -4,7 +4,7 @@ const backend = require('./backend'); // Backend exports -const { createAuthBackend, authMiddleware, User } = backend; +const { createAuthBackend, authMiddleware, User, audit } = backend; // Frontend exports const AuthStatus = require('./frontend/src/components/AuthStatus'); @@ -16,6 +16,7 @@ module.exports = { createAuthBackend, authMiddleware, User, + audit, // Frontend AuthStatus, useAuth, From 04c3c98668d1a86146a3d0d4921c1f0857de3f7a Mon Sep 17 00:00:00 2001 From: Mehul Sehgal Date: Wed, 18 Nov 2026 17:50:59 +0530 Subject: [PATCH 04/12] test(audit): add unit tests covering distinct JWT secrets rule --- __tests__/auditJwtSecrets.test.js | 65 +++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 __tests__/auditJwtSecrets.test.js diff --git a/__tests__/auditJwtSecrets.test.js b/__tests__/auditJwtSecrets.test.js new file mode 100644 index 0000000..18f29c1 --- /dev/null +++ b/__tests__/auditJwtSecrets.test.js @@ -0,0 +1,65 @@ +const { checkJwtSecrets } = require('../backend/audit/checks/jwtSecrets'); +const { audit } = require('../backend/audit'); + +describe('audit check: distinct access and refresh JWT secrets (Issue #73)', () => { + test('flags when access and refresh secrets are identical', () => { + const config = { + jwtSecret: 'super-secret-key-12345', + jwtRefreshSecret: 'super-secret-key-12345' + }; + + const findings = checkJwtSecrets(config, { env: 'development' }); + const identicalFinding = findings.find(f => f.id === 'jwt-secrets-identical'); + + expect(identicalFinding).toBeDefined(); + expect(identicalFinding.severity).toBe('warn'); + expect(identicalFinding.message).toContain('share the same secret key'); + }); + + test('escalates to error severity in production environment', () => { + const config = { + jwtSecret: 'super-secret-key-12345', + jwtRefreshSecret: 'super-secret-key-12345' + }; + + const findings = checkJwtSecrets(config, { env: 'production' }); + const identicalFinding = findings.find(f => f.id === 'jwt-secrets-identical'); + + expect(identicalFinding.severity).toBe('error'); + }); + + test('flags default/placeholder secrets', () => { + const config = { + jwtSecret: 'your-secret-key-change-in-production', + jwtRefreshSecret: 'different-custom-secret' + }; + + const findings = checkJwtSecrets(config, { env: 'production' }); + const defaultFinding = findings.find(f => f.id === 'jwt-secret-default'); + + expect(defaultFinding).toBeDefined(); + expect(defaultFinding.severity).toBe('error'); + expect(defaultFinding.remediation).toBeDefined(); + }); + + test('flags missing secrets', () => { + const findings = checkJwtSecrets({}, { env: 'production' }); + + expect(findings.some(f => f.id === 'jwt-secret-missing')).toBe(true); + expect(findings.some(f => f.id === 'jwt-refresh-secret-missing')).toBe(true); + }); + + test('passes cleanly when distinct, non-default secrets are provided', () => { + const config = { + jwtSecret: 'random-access-secret-32-chars-long-abc', + jwtRefreshSecret: 'random-refresh-secret-32-chars-long-xyz' + }; + + const findings = checkJwtSecrets(config, { env: 'production' }); + expect(findings.length).toBe(0); + + const report = audit(config, { env: 'production' }); + expect(report.passed).toBe(true); + expect(report.counts.error).toBe(0); + }); +}); From 2db4d6e75f0849479b797471a2caf0a38f349edc Mon Sep 17 00:00:00 2001 From: Mehul Sehgal Date: Wed, 18 Nov 2026 17:51:02 +0530 Subject: [PATCH 05/12] docs(readme): add Security Posture Auditing section with audit usage example --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 9417307..1f5c922 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,24 @@ function App() { } ``` +### Security Posture Auditing (`audit`) + +Dimsee provides an automated configuration auditing function (`audit`) to evaluate your authentication setup: + +```javascript +const { audit, createAuthBackend } = require("dimsee/backend"); + +const app = createAuthBackend({ /* ... */ }); +const report = audit(app); + +if (!report.passed) { + console.error("Security posture findings:", report.findings); +} +``` + +- **JWT Secrets Audit**: Checks that `jwtSecret` (for access tokens) and `jwtRefreshSecret` (for refresh tokens) are distinct, configured, and not left at default placeholders. + + ## Framework Guides Learn how to integrate Dimsee with popular React frameworks. From 6d10830c5cfee212ca43ad48ad42496f84a2b9ad Mon Sep 17 00:00:00 2001 From: Mehul Sehgal Date: Wed, 18 Nov 2026 17:51:06 +0530 Subject: [PATCH 06/12] docs(security): document distinct access and refresh secret requirements --- SECURITY.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SECURITY.md b/SECURITY.md index a90eb61..c333a04 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -45,6 +45,11 @@ Dimsee aims to give a MERN app a secure-by-default auth baseline: - **Brute force:** rate limiting on the auth endpoints. - **Transport:** designed to run behind HTTPS in production. +## Automated Security Posture Checks + +Use `audit()` to automatically detect configuration drift or weak secrets: +- Access and refresh token secrets must be distinct and non-default. + ## Known limitations & your responsibilities Dimsee is a building block, not a turnkey security guarantee. You are responsible From 35d4c09cc8d716f9227a4e1b683e0f0f679b26c1 Mon Sep 17 00:00:00 2001 From: Mehul Sehgal Date: Wed, 18 Nov 2026 17:51:09 +0530 Subject: [PATCH 07/12] docs(contributing): add security check verification item to checklist --- CONTRIBUTING.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 50a7c47..c0cea09 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -126,6 +126,7 @@ A change is ready to merge when: - [ ] New behaviour has a test (where practical) - [ ] Docs/README updated if the public API or props changed - [ ] UI changes include a screenshot +- [ ] Security checks updated and validated with audit test suite --- From 90048ddaf32f2911d3db857d7a3359ff2ff6c1bc Mon Sep 17 00:00:00 2001 From: Mehul Sehgal Date: Wed, 18 Nov 2026 17:51:12 +0530 Subject: [PATCH 08/12] chore(package): add security-audit keyword to package manifest --- package.json | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 98387b3..5e630ca 100644 --- a/package.json +++ b/package.json @@ -38,9 +38,22 @@ }, "jest": { "transform": { - "^.+\\.jsx?$": ["babel-jest", { - "presets": [["@babel/preset-env", { "targets": { "node": "current" } }], "@babel/preset-react"] - }] + "^.+\\.jsx?$": [ + "babel-jest", + { + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "node": "current" + } + } + ], + "@babel/preset-react" + ] + } + ] }, "testPathIgnorePatterns": [ "/node_modules/", @@ -62,7 +75,8 @@ "google-auth", "github-auth", "session", - "jwt" + "jwt", + "security-audit" ], "author": "Siddharth ", "license": "MIT", From 859d36031e230892be843a9a0eb29bd9611f3b3a Mon Sep 17 00:00:00 2001 From: Mehul Sehgal Date: Wed, 18 Nov 2026 17:52:57 +0530 Subject: [PATCH 09/12] feat(audit): implement checkCorsOrigin rule forbidding wildcard or insecure origins in production --- backend/audit/checks/corsOrigin.js | 83 ++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 backend/audit/checks/corsOrigin.js diff --git a/backend/audit/checks/corsOrigin.js b/backend/audit/checks/corsOrigin.js new file mode 100644 index 0000000..90e9015 --- /dev/null +++ b/backend/audit/checks/corsOrigin.js @@ -0,0 +1,83 @@ +// backend/audit/checks/corsOrigin.js +'use strict'; + +/** + * Check: no wildcard CORS origin in production (Issue #74). + * Flags a wildcard ('*') or missing corsOrigin while in production. + */ +function checkCorsOrigin(config = {}, context = {}) { + const findings = []; + const corsOrigin = config.corsOrigin || process.env.CORS_ORIGIN || process.env.FRONTEND_URL; + const isProduction = (context.env === 'production' || process.env.NODE_ENV === 'production'); + + // Check 1: Missing CORS origin in production + if (!corsOrigin) { + findings.push({ + id: 'cors-origin-missing', + rule: 'no-wildcard-cors', + severity: isProduction ? 'error' : 'warn', + title: 'Missing CORS origin configuration', + message: 'corsOrigin is not specified. In production, exact frontend origins must be pinned.', + remediation: 'Configure an explicit origin URL via config.corsOrigin or process.env.CORS_ORIGIN.' + }); + return findings; + } + + // Check 2: Wildcard CORS origin + const normalized = Array.isArray(corsOrigin) ? corsOrigin : [corsOrigin]; + + const hasWildcard = normalized.some(origin => origin === '*' || origin === '*.*'); + if (hasWildcard) { + findings.push({ + id: 'cors-origin-wildcard', + rule: 'no-wildcard-cors', + severity: isProduction ? 'error' : 'warn', + title: 'Wildcard CORS origin detected', + message: 'corsOrigin is configured with a wildcard ("*"). Wildcard origins combined with credentials allow credential theft and violate cross-origin security.', + remediation: 'Replace wildcard ("*") with exact frontend domain origins (e.g. "https://app.example.com").' + }); + } + + // Check 3: Localhost or insecure HTTP in production + if (isProduction) { + const hasInsecureOrigin = normalized.some(origin => { + if (typeof origin !== 'string') return false; + const lower = origin.toLowerCase(); + return lower.startsWith('http://') && !lower.includes('localhost') && !lower.includes('127.0.0.1'); + }); + + if (hasInsecureOrigin) { + findings.push({ + id: 'cors-origin-insecure-http', + rule: 'no-wildcard-cors', + severity: 'error', + title: 'Insecure HTTP origin in production CORS configuration', + message: 'Non-HTTPS CORS origin configured in production environment.', + remediation: 'Ensure all production CORS origins use HTTPS ("https://...").' + }); + } + + const hasLocalhostInProd = normalized.some(origin => { + if (typeof origin !== 'string') return false; + const lower = origin.toLowerCase(); + return lower.includes('localhost') || lower.includes('127.0.0.1'); + }); + + if (hasLocalhostInProd) { + findings.push({ + id: 'cors-origin-localhost-in-production', + rule: 'no-wildcard-cors', + severity: 'warn', + title: 'Localhost CORS origin in production', + message: 'corsOrigin includes localhost or 127.0.0.1 in a production environment.', + remediation: 'Remove localhost/127.0.0.1 origins from production configurations.' + }); + } + } + + return findings; +} + +module.exports = { + checkCorsOrigin +}; From b775b42a25c7431befff3561ae1f440b7366cab5 Mon Sep 17 00:00:00 2001 From: Mehul Sehgal Date: Wed, 18 Nov 2026 17:53:21 +0530 Subject: [PATCH 10/12] feat(audit): register checkCorsOrigin in audit runner --- backend/audit/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/backend/audit/index.js b/backend/audit/index.js index 169d6a7..42ce25a 100644 --- a/backend/audit/index.js +++ b/backend/audit/index.js @@ -2,12 +2,14 @@ 'use strict'; const { checkJwtSecrets } = require('./checks/jwtSecrets'); +const { checkCorsOrigin } = require('./checks/corsOrigin'); /** * Registry of available audit checks. */ const CHECKS = [ - checkJwtSecrets + checkJwtSecrets, + checkCorsOrigin ]; /** @@ -17,7 +19,6 @@ const CHECKS = [ * @returns {Object} Audit report containing findings and summary */ function audit(input = {}, options = {}) { - // Support passing app instance or raw config let config = input; if (input && input.locals && input.locals.authConfig) { config = input.locals.authConfig; @@ -55,5 +56,6 @@ function audit(input = {}, options = {}) { module.exports = { audit, CHECKS, - checkJwtSecrets + checkJwtSecrets, + checkCorsOrigin }; From e522deae61da702405058be377ed277f3ef55abd Mon Sep 17 00:00:00 2001 From: Mehul Sehgal Date: Wed, 18 Nov 2026 17:53:25 +0530 Subject: [PATCH 11/12] test(audit): add unit test coverage for wildcard and insecure CORS origin check --- __tests__/auditCorsOrigin.test.js | 55 +++++++++++++++++++++++++++++++ __tests__/auditJwtSecrets.test.js | 3 +- 2 files changed, 57 insertions(+), 1 deletion(-) create mode 100644 __tests__/auditCorsOrigin.test.js diff --git a/__tests__/auditCorsOrigin.test.js b/__tests__/auditCorsOrigin.test.js new file mode 100644 index 0000000..48c32a0 --- /dev/null +++ b/__tests__/auditCorsOrigin.test.js @@ -0,0 +1,55 @@ +const { checkCorsOrigin } = require('../backend/audit/checks/corsOrigin'); +const { audit } = require('../backend/audit'); + +describe('audit check: no wildcard CORS origin in production (Issue #74)', () => { + test('flags wildcard origin ("*") as error in production', () => { + const findings = checkCorsOrigin({ corsOrigin: '*' }, { env: 'production' }); + const wildcardFinding = findings.find(f => f.id === 'cors-origin-wildcard'); + + expect(wildcardFinding).toBeDefined(); + expect(wildcardFinding.severity).toBe('error'); + expect(wildcardFinding.message).toContain('Wildcard origins'); + }); + + test('flags wildcard origin as warning in development', () => { + const findings = checkCorsOrigin({ corsOrigin: '*' }, { env: 'development' }); + const wildcardFinding = findings.find(f => f.id === 'cors-origin-wildcard'); + + expect(wildcardFinding).toBeDefined(); + expect(wildcardFinding.severity).toBe('warn'); + }); + + test('flags missing CORS origin as error in production', () => { + const findings = checkCorsOrigin({}, { env: 'production' }); + const missingFinding = findings.find(f => f.id === 'cors-origin-missing'); + + expect(missingFinding).toBeDefined(); + expect(missingFinding.severity).toBe('error'); + }); + + test('flags insecure non-HTTPS origin in production', () => { + const findings = checkCorsOrigin( + { corsOrigin: 'http://my-insecure-site.com' }, + { env: 'production' } + ); + const insecureFinding = findings.find(f => f.id === 'cors-origin-insecure-http'); + + expect(insecureFinding).toBeDefined(); + expect(insecureFinding.severity).toBe('error'); + }); + + test('passes cleanly when an explicit HTTPS origin is configured in production', () => { + const config = { + jwtSecret: 'prod-access-secret-32-chars-long-1', + jwtRefreshSecret: 'prod-refresh-secret-32-chars-long-2', + corsOrigin: 'https://app.example.com' + }; + + const findings = checkCorsOrigin(config, { env: 'production' }); + expect(findings.length).toBe(0); + + const report = audit(config, { env: 'production' }); + expect(report.passed).toBe(true); + expect(report.counts.error).toBe(0); + }); +}); diff --git a/__tests__/auditJwtSecrets.test.js b/__tests__/auditJwtSecrets.test.js index 18f29c1..3795111 100644 --- a/__tests__/auditJwtSecrets.test.js +++ b/__tests__/auditJwtSecrets.test.js @@ -52,7 +52,8 @@ describe('audit check: distinct access and refresh JWT secrets (Issue #73)', () test('passes cleanly when distinct, non-default secrets are provided', () => { const config = { jwtSecret: 'random-access-secret-32-chars-long-abc', - jwtRefreshSecret: 'random-refresh-secret-32-chars-long-xyz' + jwtRefreshSecret: 'random-refresh-secret-32-chars-long-xyz', + corsOrigin: 'https://app.example.com' }; const findings = checkJwtSecrets(config, { env: 'production' }); From dc2f0a07c3c88f8e2bb094b63444e43a82e6fa61 Mon Sep 17 00:00:00 2001 From: Mehul Sehgal Date: Wed, 18 Nov 2026 17:53:29 +0530 Subject: [PATCH 12/12] docs(audit): document production CORS origin check in README and security policy --- README.md | 1 + SECURITY.md | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 1f5c922..06e39dd 100644 --- a/README.md +++ b/README.md @@ -103,6 +103,7 @@ if (!report.passed) { } ``` +- **CORS Origin Audit**: Flags wildcard (`"*"`), missing, or insecure HTTP origins when in production. - **JWT Secrets Audit**: Checks that `jwtSecret` (for access tokens) and `jwtRefreshSecret` (for refresh tokens) are distinct, configured, and not left at default placeholders. diff --git a/SECURITY.md b/SECURITY.md index c333a04..f342fa6 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -49,6 +49,7 @@ Dimsee aims to give a MERN app a secure-by-default auth baseline: Use `audit()` to automatically detect configuration drift or weak secrets: - Access and refresh token secrets must be distinct and non-default. +- Wildcard (`*`) and insecure HTTP origins are forbidden in production CORS configurations. ## Known limitations & your responsibilities