Skip to contentView the source on GitHub

no-open-allowed-domains

Configure explicit trusted host patterns instead of allowing every domain.

Securitywarning by default Project auditrecommended audit

astro-doctor/no-open-allowed-domains

Why it matters

An empty allowed-domain pattern matches every host and defeats the protection that security.allowedDomains is intended to provide. List the exact hostnames or constrained wildcard patterns that should be trusted.

See the difference

Incorrect

Every domain is allowed

typescriptIncorrect example
export default defineConfig({
  security: {
    allowedDomains: [{}],
  },
})

Correct

Allow an explicit trusted hostname

typescriptCorrect example
export default defineConfig({
  security: {
    allowedDomains: [
      { hostname: 'www.example.com', protocol: 'https' },
    ],
  },
})

Configure this check

Project audits are configured in doctor.config.ts:

typescriptdoctor.config.ts
export default {
  rules: {
    'astro-doctor/no-open-allowed-domains': 'error',
  },
}

Use 'error', 'warn', or 'off'. The configuration guide covers presets and per-file overrides.

Keep exploring security

Browse every rule and project audit