Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

http

Rules: 70

http/accept-ch

The Accept-CH header is malformed

http/accept-ch/invalid · warning · score 3.9 · page

Browsers ignore a header they cannot parse, so the client hints the site asked for are never sent and content adapted to them falls back to the default. Only responses that send Accept-CH are checked.

Reported as

Accept-CH breaks its structured-field grammar, so browsers ignore it

Fix

Send Accept-CH as a list of hint names, as in Accept-CH: Sec-CH-UA-Platform.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.accept-ch.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.parsed.accept-ch": {
    "type": "object"
  }
}

http/alt-svc-h3

The server does not advertise HTTP/3 in Alt-Svc

http/alt-svc-h3/missing · warning · score 5.2 · page

Without the advertisement, browsers keep using HTTP/2 and never try the faster, loss-tolerant HTTP/3. Only HTTPS responses that did not already arrive over HTTP/3 are checked.

Reported as

Alt-Svc should advertise h3

Fix

Add h3 to the Alt-Svc header.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.alt-svc.value

Expects

{
  "type": "array",
  "contains": {
    "properties": {
      "protocol": {
        "const": "h3"
      }
    },
    "required": [
      "protocol"
    ]
  }
}

When

{
  "url.protocol": "https:",
  "http.version": {
    "not": {
      "const": "3.0"
    }
  },
  "http.parsed.alt-svc.errors": {
    "maxItems": 0
  }
}

http/alt-svc

The Alt-Svc header is malformed

http/alt-svc/invalid · warning · score 4.4 · page

Browsers ignore a header they cannot parse, so they never switch to the alternative service such as HTTP/3. Only responses that send Alt-Svc are checked.

Reported as

Alt-Svc breaks RFC 7838 §3, so clients never try the alternative

Fix

Send Alt-Svc as h3=“:443”; ma=86400.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.alt-svc.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.parsed.alt-svc": {
    "type": "object"
  }
}

http/cache-control

The Cache-Control header is malformed

http/cache-control/invalid · warning · score 5.0 · page

Caches ignore directives they cannot read, so the page may be cached for the wrong time or not at all. Only responses that send Cache-Control are checked.

Reported as

Cache-Control breaks RFC 9111 §5.2, and caches ignore what they cannot read

Fix

Write Cache-Control with registered directives only, as in public, max-age=3600.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.cache-control.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.parsed.cache-control": {
    "type": "object"
  }
}

An HTML page sends no Cache-Control directive

http/cache-control/missing · info · score 2.7 · page

Without Cache-Control, browsers and CDNs guess how long to keep the page, so visitors may see stale content or reload it needlessly. Only 2xx HTML pages are checked.

Reported as

no Cache-Control directive on an HTML page

Fix

Add a Cache-Control header, e.g. no-cache to revalidate, or public with a max-age.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.cache-control.value

Expects

{
  "type": "object",
  "minProperties": 1
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 299
  },
  "http.content-type": {
    "pattern": "^text/html"
  },
  "http.parsed.cache-control.errors": {
    "maxItems": 0
  }
}

http/cache-status

The Cache-Status header is malformed

http/cache-status/invalid · warning · score 3.3 · page

Tools that read cache diagnostics cannot parse it, so debugging a slow or stale page gets harder. Only responses that send Cache-Status are checked.

Reported as

Cache-Status breaks its structured-field grammar

Fix

Send Cache-Status as a list of caches with parameters, as in Cache-Status: ExampleCache; hit.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.cache-status.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.parsed.cache-status": {
    "type": "object"
  }
}

http/coep

The Cross-Origin-Embedder-Policy header is malformed

http/coep/invalid · warning · score 3.8 · page

Browsers ignore a header they cannot parse, so the page cannot become cross-origin isolated. Only responses that send it are checked.

Reported as

Cross-Origin-Embedder-Policy breaks its structured-field grammar, so browsers ignore it

Fix

Send Cross-Origin-Embedder-Policy: credentialless.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.cross-origin-embedder-policy.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.parsed.cross-origin-embedder-policy": {
    "type": "object"
  }
}

The page sends no Cross-Origin-Embedder-Policy

http/coep/missing · hint · score 0.8 · page

Without it, the page cannot become cross-origin isolated, which browsers require for features such as high-resolution timers and shared memory. Only HTML pages that answer 2xx are checked. This is an optional hardening.

Reported as

no Cross-Origin-Embedder-Policy

Fix

Send Cross-Origin-Embedder-Policy: credentialless once every embed loads under it.

Off by default; a group that runs suggestions turns it on.

References

For rule authors

Reads

  • http.parsed.cross-origin-embedder-policy

Expects

{
  "type": "object"
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 299
  },
  "http.content-type": {
    "pattern": "^text/html"
  }
}

Cross-Origin-Embedder-Policy is not require-corp or credentialless

http/coep/weak · hint · score 0.8 · page

Other values do not isolate the page from cross-origin content, so features that need isolation stay unavailable. Only HTML pages that answer 2xx and send a valid header are checked.

Reported as

Cross-Origin-Embedder-Policy should be require-corp or credentialless

Fix

Send Cross-Origin-Embedder-Policy: credentialless once every embed loads under it.

Off by default; a group that runs suggestions turns it on.

References

For rule authors

Reads

  • http.parsed.cross-origin-embedder-policy.value

Expects

{
  "enum": [
    "require-corp",
    "credentialless"
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 299
  },
  "http.content-type": {
    "pattern": "^text/html"
  },
  "http.parsed.cross-origin-embedder-policy.errors": {
    "maxItems": 0
  },
  "http.parsed.cross-origin-embedder-policy": {
    "type": "object"
  }
}

http/compression

A text response over 1 KB is sent uncompressed

http/compression/missing · warning · score 6.3 · page

Uncompressed HTML, CSS, JavaScript and JSON take several times more bytes to transfer, which slows pages on slow connections and costs visitors mobile data. Only 2xx text responses of at least 1 KB are checked.

Reported as

a text response over 1 KB is sent uncompressed

Fix

Compress text responses with br, zstd or gzip at the edge or in the server.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers.content-encoding

Expects

{
  "type": [
    "string",
    "array"
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 299
  },
  "http.content-type": {
    "pattern": "^(text/|application/([\\w.-]+\\+)?(json|xml|javascript)\\b|image/svg\\+xml)"
  },
  "http.size.decoded": {
    "minimum": 1024
  }
}

A text response over 1 KB uses an unusual compression

http/compression/weak · warning · score 6.3 · page

Browsers support br, zstd and gzip; other encodings may be ignored or decoded slowly, so visitors may get the full uncompressed size or an error. Only 2xx text responses of at least 1 KB that declare a Content-Encoding are checked.

Reported as

a text response over 1 KB is encoded with something other than br, zstd or gzip

Fix

Compress text responses with br, zstd or gzip at the edge or in the server.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers.content-encoding

Expects

{
  "type": "string",
  "pattern": "^\\s*(br|gzip|zstd)\\s*$"
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 299
  },
  "http.content-type": {
    "pattern": "^(text/|application/([\\w.-]+\\+)?(json|xml|javascript)\\b|image/svg\\+xml)"
  },
  "http.size.decoded": {
    "minimum": 1024
  },
  "http.headers.content-encoding": {
    "type": [
      "string",
      "array"
    ]
  }
}

http/content-length

A response’s Content-Length does not match its body

http/content-length/invalid · warning · score 5.4 · site

Wrong framing makes browsers truncate or reject the response and lets proxies disagree about where it ends, which attackers use for request smuggling. Covers a short body, Content-Length beside Transfer-Encoding or sent twice, and one on a 204.

Fix

Send one Content-Length equal to the body, none beside Transfer-Encoding and none on a 204.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers
  • resources

http/content-type-options

X-Content-Type-Options is not nosniff

http/content-type-options/invalid · warning · score 5.7 · page

Any other value does not switch off type guessing, so the protection is not active. Only responses that send the header are checked.

Reported as

X-Content-Type-Options should be nosniff

Fix

Send X-Content-Type-Options: nosniff.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers.x-content-type-options

Expects

{
  "type": "string",
  "pattern": "^nosniff$"
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.headers.x-content-type-options": {
    "type": [
      "string",
      "array"
    ]
  }
}

The response lacks X-Content-Type-Options

http/content-type-options/missing · warning · score 5.7 · page

Without nosniff, a browser may guess a file’s type and run an uploaded file as a script, which opens the way to attacks on visitors.

Reported as

no X-Content-Type-Options

Fix

Send X-Content-Type-Options: nosniff.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers.x-content-type-options

Expects

{
  "type": [
    "string",
    "array"
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  }
}

http/content-type

The Content-Type header is malformed

http/content-type/invalid · warning · score 4.0 · page

Browsers may guess the type or charset of a response they cannot read the header for, which can break rendering or decoding. Only responses that send Content-Type are checked.

Reported as

Content-Type breaks RFC 9110 §8.3.1

Fix

Send Content-Type as type/subtype with name=value parameters, as in text/html; charset=utf-8.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.content-type.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.parsed.content-type": {
    "type": "object"
  }
}

http/coop

The Cross-Origin-Opener-Policy header is malformed

http/coop/invalid · warning · score 3.9 · page

Browsers ignore a header they cannot parse, so the page gets no isolation from windows of other sites. Only HTML documents that send it are checked.

Reported as

Cross-Origin-Opener-Policy breaks its structured-field grammar, so browsers ignore it

Fix

Send Cross-Origin-Opener-Policy: same-origin.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.cross-origin-opener-policy.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.parsed.cross-origin-opener-policy": {
    "type": "object"
  }
}

The page sends no Cross-Origin-Opener-Policy

http/coop/missing · info · score 2.2 · page

Without it, windows opened from other sites keep a link to the page, which lets them probe it through side channels. Only HTML documents are checked.

Reported as

no Cross-Origin-Opener-Policy

Fix

Send Cross-Origin-Opener-Policy: same-origin.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.cross-origin-opener-policy

Expects

{
  "type": "object"
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true
}

Cross-Origin-Opener-Policy is too permissive

http/coop/weak · info · score 2.2 · page

Only same-origin and same-origin-allow-popups isolate the page. Other values, such as unsafe-none, leave the page linked to windows from other sites, so the isolation the header promises is absent. Only HTML documents with a valid header are checked.

Reported as

Cross-Origin-Opener-Policy should be same-origin or same-origin-allow-popups

Fix

Send Cross-Origin-Opener-Policy: same-origin.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.cross-origin-opener-policy.value

Expects

{
  "enum": [
    "same-origin",
    "same-origin-allow-popups"
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.parsed.cross-origin-opener-policy.errors": {
    "maxItems": 0
  },
  "http.parsed.cross-origin-opener-policy": {
    "type": "object"
  }
}

http/corp

Cross-Origin-Resource-Policy is not a valid value

http/corp/invalid · info · score 2.1 · page

Browsers ignore an unknown value, so the resource stays open to other sites. Only responses that send the header are checked.

Reported as

Cross-Origin-Resource-Policy should be same-origin, same-site or cross-origin

Fix

Send Cross-Origin-Resource-Policy: same-origin, or same-site if the resource is shared.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers.cross-origin-resource-policy

Expects

{
  "enum": [
    "same-origin",
    "same-site",
    "cross-origin"
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.headers.cross-origin-resource-policy": {
    "type": [
      "string",
      "array"
    ]
  }
}

The response lacks Cross-Origin-Resource-Policy

http/corp/missing · info · score 2.1 · page

Without it, any other site may embed the resource, which can leak its content through side channels or let others use it for free.

Reported as

no Cross-Origin-Resource-Policy

Fix

Send Cross-Origin-Resource-Policy: same-origin, or same-site if the resource is shared.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers.cross-origin-resource-policy

Expects

{
  "type": [
    "string",
    "array"
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  }
}

http/csp-base-uri

Content-Security-Policy lacks base-uri

http/csp-base-uri/missing · info · score 2.6 · page

An attacker who can inject a base tag can redirect every relative script and link to their own server. Only HTML documents that send a policy are checked.

Reported as

Content-Security-Policy lacks base-uri, so an injected <base> can redirect relative scripts

Fix

Add base-uri to the Content-Security-Policy, e.g. the site origin.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.csp.directives

Expects

{
  "required": [
    "base-uri"
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.csp.directives": {
    "type": "object"
  }
}

http/csp-frame-ancestors

Content-Security-Policy lacks frame-ancestors

http/csp-frame-ancestors/missing · info · score 2.9 · page

Any other site may then frame the page, which enables clickjacking, where visitors are tricked into clicking hidden controls. The directive works only in a header, not in a meta tag. Only HTML documents that send a policy are checked.

Reported as

Content-Security-Policy lacks frame-ancestors, which only a header can carry

Fix

Add frame-ancestors to the Content-Security-Policy.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.csp.directives

Expects

{
  "required": [
    "frame-ancestors"
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.csp.directives": {
    "type": "object"
  }
}

http/csp-object-src

Content-Security-Policy does not set object-src to none

http/csp-object-src/weak · warning · score 5.5 · page

Plugins and embedded objects can still load, which gives attackers an old route to run code on the page. Only HTML documents that send a policy are checked.

Reported as

Content-Security-Policy should set object-src ‘none’

Fix

Set object-src ‘none’ in the Content-Security-Policy.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.csp.directives

Expects

{
  "if": {
    "required": [
      "object-src"
    ]
  },
  "then": {
    "properties": {
      "object-src": {
        "maxItems": 1,
        "items": {
          "pattern": "^(?i:'none')$"
        }
      }
    }
  },
  "else": {
    "required": [
      "default-src"
    ],
    "properties": {
      "default-src": {
        "maxItems": 1,
        "items": {
          "pattern": "^(?i:'none')$"
        }
      }
    }
  }
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.csp.directives": {
    "type": "object"
  }
}

http/csp-script-src

Content-Security-Policy trusts scripts from any host

http/csp-script-src/insecure · warning · score 6.1 · page

A * or scheme-only source such as https: lets scripts load from any site, so an attacker only has to host a script anywhere to run it. Only HTML documents that send a policy are checked.

Reported as

Content-Security-Policy loads scripts from any host through a * or scheme-only source

Fix

Replace * and scheme-only sources with specific origins.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.csp.directives

Expects

{
  "if": {
    "required": [
      "script-src"
    ]
  },
  "then": {
    "properties": {
      "script-src": {
        "not": {
          "contains": {
            "pattern": "^(?i:\\*|[a-z][a-z0-9+.-]*:)$"
          }
        }
      }
    }
  },
  "else": {
    "properties": {
      "default-src": {
        "not": {
          "contains": {
            "pattern": "^(?i:\\*|[a-z][a-z0-9+.-]*:)$"
          }
        }
      }
    }
  }
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.csp.directives": {
    "type": "object"
  }
}

Content-Security-Policy restricts no scripts

http/csp-script-src/missing · warning · score 6.3 · page

With neither script-src nor default-src, any script from any origin may run, so the policy gives no protection against injected scripts. Only HTML documents that send a policy are checked.

Reported as

Content-Security-Policy sets neither script-src nor default-src, so any script loads

Fix

Set script-src to the origins that may run scripts, or default-src if every directive needs the same.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.csp.directives

Expects

{
  "anyOf": [
    {
      "required": [
        "script-src"
      ]
    },
    {
      "required": [
        "default-src"
      ]
    }
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.csp.directives": {
    "type": "object"
  }
}

http/csp-trusted-types

Content-Security-Policy does not require Trusted Types

http/csp-trusted-types/missing · info · score 2.4 · page

Without Trusted Types, a script can feed untrusted text into dangerous browser functions and open the page to DOM-based cross-site scripting. Only HTML documents that send a policy are checked.

Reported as

Content-Security-Policy lacks require-trusted-types-for ‘script’

Fix

Add require-trusted-types-for ‘script’ to the Content-Security-Policy.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.csp.directives

Expects

{
  "required": [
    "require-trusted-types-for"
  ],
  "properties": {
    "require-trusted-types-for": {
      "contains": {
        "pattern": "^(?i:'script')$"
      }
    }
  }
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.csp.directives": {
    "type": "object"
  }
}

http/csp-unsafe-eval

Content-Security-Policy allows eval()

http/csp-unsafe-eval/present · warning · score 6.0 · page

With ’unsafe-eval’, text turned into code at run time executes, which gives an attacker who controls such text a way to run scripts. Only HTML documents that send a policy are checked.

Reported as

Content-Security-Policy allows eval() with ‘unsafe-eval’

Fix

Remove ‘unsafe-eval’ from script-src.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.csp.directives

Expects

{
  "if": {
    "required": [
      "script-src"
    ]
  },
  "then": {
    "properties": {
      "script-src": {
        "not": {
          "contains": {
            "pattern": "^(?i:'unsafe-eval')$"
          }
        }
      }
    }
  },
  "else": {
    "properties": {
      "default-src": {
        "not": {
          "contains": {
            "pattern": "^(?i:'unsafe-eval')$"
          }
        }
      }
    }
  }
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.csp.directives": {
    "type": "object"
  }
}

http/csp-unsafe-inline

Content-Security-Policy allows inline scripts

http/csp-unsafe-inline/present · warning · score 6.2 · page

With ’unsafe-inline’, any script an attacker injects into the page runs, so the policy no longer stops cross-site scripting. Only HTML documents that send a policy are checked.

Reported as

Content-Security-Policy allows inline scripts with ‘unsafe-inline’ and no nonce or hash

Fix

Replace ‘unsafe-inline’ with nonces or hashes.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.csp.directives

Expects

{
  "if": {
    "required": [
      "script-src"
    ]
  },
  "then": {
    "properties": {
      "script-src": {
        "not": {
          "contains": {
            "pattern": "^(?i:'unsafe-inline')$"
          }
        }
      }
    }
  },
  "else": {
    "properties": {
      "default-src": {
        "not": {
          "contains": {
            "pattern": "^(?i:'unsafe-inline')$"
          }
        }
      }
    }
  }
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.csp.directives": {
    "type": "object"
  }
}

http/csp-upgrade-insecure

Content-Security-Policy lacks upgrade-insecure-requests

http/csp-upgrade-insecure/missing · warning · score 5.3 · page

Without the directive, a leftover http:// link or resource on an HTTPS page loads insecurely, and attackers on the network can read or alter it. Only HTTPS documents that send a policy are checked.

Reported as

Content-Security-Policy lacks upgrade-insecure-requests

Fix

Add upgrade-insecure-requests to the Content-Security-Policy.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.csp.directives

Expects

{
  "required": [
    "upgrade-insecure-requests"
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "url.protocol": "https:",
  "http.csp.directives": {
    "type": "object"
  }
}

http/csp

The Content-Security-Policy header is malformed

http/csp/invalid · warning · score 5.9 · page

Browsers drop the directives they cannot read, so part of the policy, or all of it, may not be enforced. Only HTML documents that send a policy are checked.

Reported as

Content-Security-Policy breaks CSP 3, and browsers drop what they cannot read

Fix

Spell every directive as CSP 3 names it and quote keywords, as in script-src ‘self’.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.content-security-policy.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.parsed.content-security-policy": {
    "type": "object"
  }
}

The page has no enforced Content-Security-Policy

http/csp/missing · warning · score 6.4 · page

Without a policy, an injected script runs with the full rights of the page, so a single cross-site scripting hole can steal sessions or data. Only HTML documents are checked, and a policy in a meta tag counts.

Reported as

no enforced Content-Security-Policy, in a header or a <meta>

Fix

Send a Content-Security-Policy header that allows only the origins and directives the page needs.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.csp.directives

Expects

{
  "type": "object"
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true
}

http/date

The Date header is not in the standard date format

http/date/invalid · warning · score 4.2 · page

Caches and clients that cannot parse Date fall back to guessing the response’s age, which breaks freshness calculations. HTTP requires the fixed GMT form, such as Sun, 06 Nov 1994 08:49:37 GMT. Only responses that send Date are checked.

Reported as

Date should be an IMF-fixdate

Fix

Send Date in IMF-fixdate form, as Sun, 06 Nov 1994 08:49:37 GMT.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers.date

Expects

{
  "type": "string",
  "pattern": "^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), \\d{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d{4} \\d{2}:\\d{2}:\\d{2} GMT$"
}

When

{
  "http.headers.date": {
    "type": [
      "string",
      "array"
    ]
  }
}

The server’s clock differs from ours

http/date/mismatch · warning · score 3.4–6.8 · site

A clock that is minutes off can break certificate validity, signed tokens, cache freshness and log correlation; an hour or more is an error. Skipped when every host is off alike, which points at the checking machine instead.

Fix

Synchronise the server clock with NTP (chrony or systemd-timesyncd).

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.date-skew

The response has no Date header

http/date/missing · warning · score 4.2 · page

Without Date, caches cannot work out how old a response is, so they may serve stale content or cache it badly. Clients that compare clocks lose a reference too.

Reported as

no Date header

Fix

Send Date in IMF-fixdate form, as Sun, 06 Nov 1994 08:49:37 GMT.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers.date

Expects

{
  "type": [
    "string",
    "array"
  ]
}

http/deprecation

The Deprecation header is not an @ and Unix seconds

http/deprecation/invalid · warning · score 3.6 · page

Clients that cannot read the value will not warn that the resource is deprecated. Only responses that send Deprecation are checked.

Reported as

Deprecation should be @ and Unix seconds

Fix

Send Deprecation: @1704067200 with the Unix timestamp of the removal.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers.deprecation

Expects

{
  "type": "string",
  "pattern": "^@-?\\d+$"
}

When

{
  "http.headers.deprecation": {
    "type": "string"
  }
}

http/digest

The response has neither Content-Digest nor Repr-Digest

http/digest/missing · hint · score 0.6 · page

Without a digest, a client or intermediary cannot verify that the body arrived intact and unaltered. This is an optional hardening for HTML pages that answer 2xx.

Reported as

no Content-Digest or Repr-Digest lets a client check the body

Fix

Send Repr-Digest: sha-256=:<base64 digest>: with each response.

Off by default; a group that runs suggestions turns it on.

References

For rule authors

Reads

  • http.headers

Expects

{
  "anyOf": [
    {
      "required": [
        "content-digest"
      ]
    },
    {
      "required": [
        "repr-digest"
      ]
    }
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 299
  },
  "http.content-type": {
    "pattern": "^text/html"
  }
}

http/early-hints-preload

A preload from the 103 Early Hints is missing from the final response

http/early-hints-preload/mismatch · info · score 1.8 · page

The browser starts fetching what the early hint announced, but the final response no longer asks for it, so the early fetch is wasted or the resource loads late. Only responses that sent a 103 are checked.

Fix

Remove the preload from the 103 Early Hints, or add it to the final Link header.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.early-hints
  • http.parsed.link

http/frame-options

Other sites can embed the page in a frame

http/frame-options/missing · info · score 3.0 · page

An attacker’s page can load this one in a hidden frame and trick visitors into clicking its buttons (clickjacking). A frame-ancestors directive in the Content-Security-Policy, or X-Frame-Options set to DENY or SAMEORIGIN, forbids it.

Fix

Send a Content-Security-Policy frame-ancestors directive, or X-Frame-Options: DENY.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.csp.directives
  • http.headers.x-frame-options

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true
}

http/header

The page sends headers that no current browser reads

http/header/deprecated · info · score 1.2 · page

X-XSS-Protection, Expect-CT, Public-Key-Pins, Feature-Policy, P3P and Report-To are dead weight on every response, and some give a false sense of protection. Report-To is left alone while NEL still reads it.

Fix

Remove each deprecated header, and send Reporting-Endpoints in place of Report-To unless NEL still reads it.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  }
}

http/host

Pages of one host differ in certificate, TLS version or server

http/host/inconsistent · info · score 2.8 · site

Pages of one host answering from differently configured servers usually mean a misconfigured load balancer or a half-finished migration, so some visitors get an older TLS version or a stale certificate. The server address is not compared behind a CDN that names itself in Server.

Fix

Make every page of the host serve the same certificate, TLS protocol and Server header.

Runs by default, in the recommended ruleset.

For rule authors

Reads

  • tls.cert.fingerprint256
  • tls.protocol
  • http.remote.address
  • http.headers.server

http/hsts-subdomains

Strict-Transport-Security omits includeSubDomains

http/hsts-subdomains/missing · info · score 2.5 · page

Without it, subdomains are not forced onto HTTPS, so an attacker can use an insecure subdomain to capture cookies of the main site. Only HTTPS responses with a valid header are checked.

Reported as

Strict-Transport-Security should carry includeSubDomains

Fix

Add includeSubDomains to the Strict-Transport-Security header.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.strict-transport-security.value

Expects

{
  "required": [
    "includesubdomains"
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "url.protocol": "https:",
  "http.parsed.strict-transport-security.value": {
    "type": "object"
  }
}

http/hsts

The Strict-Transport-Security header is malformed

http/hsts/invalid · warning · score 5.6 · page

Browsers ignore a header they cannot parse, so the HTTPS-only protection never starts. Only responses that send it are checked.

Reported as

Strict-Transport-Security breaks RFC 6797 §6.1, so browsers ignore it

Fix

Send Strict-Transport-Security once, as max-age=63072000; includeSubDomains.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.strict-transport-security.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.parsed.strict-transport-security": {
    "type": "object"
  }
}

The site does not send Strict-Transport-Security

http/hsts/missing · warning · score 5.8 · page

Without HSTS, a visitor’s first request, or one on a hostile network, can be downgraded to plain HTTP and intercepted. Only HTTPS responses with a status from 200 to 499, except 429, are checked.

Reported as

no Strict-Transport-Security

Fix

Send Strict-Transport-Security: max-age=63072000; includeSubDomains.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.strict-transport-security

Expects

{
  "type": "object"
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "url.protocol": "https:"
}

Strict-Transport-Security has a short max-age

http/hsts/weak · warning · score 5.8 · page

A short max-age lets the browser forget the HTTPS-only rule soon, so the protection lapses between visits and a downgrade attack works again. Only HTTPS responses with a valid header are checked.

Reported as

Strict-Transport-Security should carry max-age of 1000000 or more

Fix

Send Strict-Transport-Security: max-age=63072000; includeSubDomains.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.strict-transport-security.value.max-age

Expects

{
  "type": "integer",
  "minimum": 1000000
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "url.protocol": "https:",
  "http.parsed.strict-transport-security.errors": {
    "maxItems": 0
  },
  "http.parsed.strict-transport-security": {
    "type": "object"
  }
}

The Link header is malformed

http/link/invalid · warning · score 4.6 · page

Clients drop the links they cannot parse, so preloads and other hints in it never take effect. Only responses that send Link are checked.

Reported as

Link breaks RFC 8288 §3, so clients drop the links they cannot read

Fix

Write each Link entry as <https://example.com/a>; rel=preload, separated by commas.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.link.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.parsed.link": {
    "type": "object"
  }
}

http/no-store

Cache-Control: no-store keeps the page out of the back/forward cache

http/no-store/present · info · score 2.4 · page

Browsers will not keep a no-store page for instant back and forward navigation, so those moves reload the page and feel slower. Only HTML pages that send Cache-Control are checked.

Reported as

Cache-Control no-store keeps the page out of the back/forward cache

Fix

Remove no-store from Cache-Control, or replace it with no-cache.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.cache-control.value

Expects

{
  "not": {
    "required": [
      "no-store"
    ]
  }
}

When

{
  "http.content-type": {
    "pattern": "^text/html"
  },
  "http.parsed.cache-control.value": {
    "type": "object"
  }
}

A URL with a query has no No-Vary-Search

http/no-vary-search/missing · hint · score 0.4 · page

Without it, caches treat every query-string variant as a different page, so tracking parameters cause needless cache misses and reloads. Only HTML pages that answer 2xx and have a query are checked.

Reported as

a URL with a query has no No-Vary-Search to say which parameters change the page

Fix

Send No-Vary-Search: params=(“utm_source” “utm_medium”) naming the parameters that do not change the page.

Off by default; a group that runs suggestions turns it on.

References

For rule authors

Reads

  • http.headers.no-vary-search

Expects

{
  "type": "string",
  "minLength": 1
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 299
  },
  "http.content-type": {
    "pattern": "^text/html"
  },
  "url.search": {
    "minLength": 1
  }
}

http/permissions-policy

The Permissions-Policy header is malformed

http/permissions-policy/invalid · warning · score 3.7 · page

Browsers ignore a header they cannot parse, so the features it was meant to restrict stay available to the page and its frames. Only HTML documents that send it are checked.

Reported as

Permissions-Policy breaks its structured-field grammar, so browsers ignore it

Fix

Write Permissions-Policy as a dictionary, as in camera=(), geolocation=(self).

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.permissions-policy.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.parsed.permissions-policy": {
    "type": "object"
  }
}

The page sends no Permissions-Policy naming a feature

http/permissions-policy/missing · info · score 1.8 · page

Without a policy, the page and every embedded frame may use powerful browser features such as camera, microphone or location unless the browser blocks them. Only HTML documents are checked.

Reported as

no Permissions-Policy header naming a feature

Fix

Send a Permissions-Policy header listing the features the page uses.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.permissions-policy.value

Expects

{
  "type": "object",
  "minProperties": 1
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.document": true,
  "http.parsed.permissions-policy.errors": {
    "maxItems": 0
  }
}

http/priority

The Priority header is malformed

http/priority/invalid · warning · score 3.8 · page

Clients ignore a header they cannot parse, so the hint about how urgent the response is has no effect. Only responses that send Priority are checked.

Reported as

Priority breaks its structured-field grammar, so clients ignore it

Fix

Send Priority as a dictionary, as in Priority: u=1, i.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.priority.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.parsed.priority": {
    "type": "object"
  }
}

http/referrer-policy

Referrer-Policy leaks full URLs to other sites

http/referrer-policy/insecure · warning · score 5.1 · page

The unsafe-url and no-referrer-when-downgrade values send the full address, query string included, to other sites, which can expose private details. Only responses with a valid header are checked.

Reported as

Referrer-Policy should not leak full URLs

Fix

Send Referrer-Policy: strict-origin-when-cross-origin, or no-referrer.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.referrer-policy.value

Expects

{
  "type": "string",
  "not": {
    "enum": [
      "unsafe-url",
      "no-referrer-when-downgrade"
    ]
  }
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.parsed.referrer-policy.errors": {
    "maxItems": 0
  },
  "http.parsed.referrer-policy": {
    "type": "object"
  }
}

The Referrer-Policy header holds an unknown value

http/referrer-policy/invalid · warning · score 4.0 · page

Browsers ignore values they do not know, and may fall back to a policy that leaks more of the URL than intended. Only responses that send it are checked.

Reported as

Referrer-Policy breaks the Referrer Policy tokens

Fix

Send Referrer-Policy: strict-origin-when-cross-origin.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.referrer-policy.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.parsed.referrer-policy": {
    "type": "object"
  }
}

The response sends no Referrer-Policy

http/referrer-policy/missing · warning · score 5.1 · page

Without a policy, browsers decide what to send, and full page URLs, which may hold private details, can leak to other sites when visitors follow links.

Reported as

no Referrer-Policy

Fix

Send Referrer-Policy: strict-origin-when-cross-origin, or no-referrer.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.referrer-policy

Expects

{
  "type": "object"
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  }
}

http/reporting-endpoints

The Reporting-Endpoints header is malformed

http/reporting-endpoints/invalid · warning · score 3.4 · page

Browsers ignore a header they cannot parse, so no violation or crash reports are ever sent. Only responses that send it are checked.

Reported as

Reporting-Endpoints breaks its structured-field grammar, so browsers ignore it

Fix

Send Reporting-Endpoints: default=“/reports”.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.reporting-endpoints.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.parsed.reporting-endpoints": {
    "type": "object"
  }
}

The response names no Reporting-Endpoints

http/reporting-endpoints/missing · info · score 1.5 · page

Without an endpoint, browsers cannot report policy violations, crashes or deprecations, so the owner never learns of problems that visitors hit.

Reported as

no Reporting-Endpoints header naming an endpoint

Fix 1

Send a Reporting-Endpoints header naming your reporting endpoints.

Fix 2

Report Relay https://dbuho.me/project/report-relay/ collects these reports and sends them to your Grafana: open source, self-hosted, free.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.reporting-endpoints.value

Expects

{
  "type": "object",
  "minProperties": 1
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  },
  "http.parsed.reporting-endpoints.errors": {
    "maxItems": 0
  }
}

http/retry-after

The Retry-After header is malformed

http/retry-after/invalid · warning · score 4.1 · page

Clients cannot tell when to retry, so they retry at once or give up. Only responses that send Retry-After are checked.

Reported as

Retry-After breaks RFC 9110 §10.2.3, so clients cannot tell when to retry

Fix

Send Retry-After as a number of seconds, as in Retry-After: 120, or an IMF-fixdate.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.retry-after.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.parsed.retry-after": {
    "type": "object"
  }
}

A 503 response does not say when to retry

http/retry-after/missing · warning · score 4.8 · page

Without Retry-After, clients and crawlers retry at once or give up, which adds load to a server that is already struggling or drops the site from results. Only 503 responses are checked.

Reported as

a 503 should say when to retry with Retry-After

Fix

Send Retry-After with a delay, or an HTTP-date for when to try again.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.retry-after.value

Expects

{
  "type": "object"
}

When

{
  "http.status": 503,
  "http.parsed.retry-after.errors": {
    "maxItems": 0
  }
}

Retry-After asks clients back too soon

http/retry-after/weak · info · score 1.2–3.0 · page

A delay under 10 seconds brings clients straight back to a server that is already shedding load, which keeps it overloaded. Only 429 and 503 responses with a readable Retry-After are checked.

Reported as

Retry-After asks clients back too soon, which brings the load straight back to a server that is shedding it

Fix

Send Retry-After: 120, or as long as the server needs to recover.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.retry-after.value.seconds

Expects

{
  "minimum": 10
}

When

{
  "http.status": {
    "enum": [
      429,
      503
    ]
  },
  "http.parsed.retry-after.value": {
    "type": "object"
  }
}

http/server-timing

A development or staging site sends no Server-Timing

http/server-timing/missing · hint · score 0.2 · page

Without it, developers and browser tools cannot see where the server spent its time. Only sites declared as development or staging are checked.

Reported as

no Server-Timing header shows where the server spent its time

Fix

Send Server-Timing: app;dur=<milliseconds> with durations that name no internals.

Off by default; a group that runs suggestions turns it on.

References

For rule authors

Reads

  • http.headers.server-timing

Expects

{
  "type": "string",
  "minLength": 1
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 299
  },
  "http.content-type": {
    "pattern": "^text/html"
  },
  "site.role": {
    "enum": [
      "development",
      "staging"
    ]
  }
}

http/server

The server reveals the software behind it

http/server/disclosing · warning · score 5.0 · site

Headers such as Server and X-Powered-By, and the generator meta tag, name the product and often its version, which tells attackers which known flaws to try. Names a CDN or host sets and the owner cannot remove are not reported, and a name without a version is only a hint.

Fix

Remove the version from the Server header and drop X-Powered-By and debug headers at the server or proxy.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers
  • html.meta.generator
  • resources

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  }
}

http/sunset

The Sunset header is not an HTTP date

http/sunset/invalid · warning · score 3.7 · page

Clients that cannot read the date will not warn that the resource is going away. Only responses that send Sunset are checked.

Reported as

Sunset should be an HTTP-date

Fix

Send Sunset as an HTTP-date, e.g. Sun, 01 Jan 2027 00:00:00 GMT.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers.sunset

Expects

{
  "type": "string",
  "pattern": "^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), \\d{2} (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) \\d{4} \\d{2}:\\d{2}:\\d{2} GMT$"
}

When

{
  "http.headers.sunset": {
    "type": "string"
  }
}

http/tdm-reservation

The tdm-reservation header is not 0 or 1

http/tdm-reservation/invalid · warning · score 3.5 · page

Text-and-data-mining crawlers cannot read the site’s reservation, so they may mine content the owner meant to reserve. Only responses that send the header are checked.

Reported as

tdm-reservation should be 0 or 1

Fix

Send tdm-reservation: 1 to reserve text and data mining rights, 0 to waive them.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers.tdm-reservation

Expects

{
  "type": "string",
  "pattern": "^\\s*[01]\\s*$"
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 299
  },
  "http.headers.tdm-reservation": {
    "type": "string"
  }
}

http/use-as-dictionary-match

Use-As-Dictionary has no match pattern

http/use-as-dictionary-match/invalid · warning · score 3.5 · page

A dictionary without a match pattern is never used for later requests, so the compression it was meant to improve does not happen. Only responses that send Use-As-Dictionary are checked.

Reported as

Use-As-Dictionary needs a match=“<URL pattern>” member

Fix

Send Use-As-Dictionary: match=“/assets/app-*.js”.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.use-as-dictionary.value

Expects

{
  "required": [
    "match"
  ],
  "properties": {
    "match": {
      "type": "string"
    }
  }
}

When

{
  "http.parsed.use-as-dictionary.value": {
    "type": "object"
  }
}

http/use-as-dictionary

The Use-As-Dictionary header is malformed

http/use-as-dictionary/invalid · warning · score 3.4 · page

Clients ignore a header they cannot parse, so the dictionary is never used and the compression gain is lost. Only responses that send Use-As-Dictionary are checked.

Reported as

Use-As-Dictionary breaks its structured-field grammar, so clients ignore it

Fix

Send Use-As-Dictionary: match=“/assets/app-*.js”.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.use-as-dictionary.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.parsed.use-as-dictionary": {
    "type": "object"
  }
}

http/validator

The response has neither ETag nor Last-Modified

http/validator/missing · info · score 2.6 · page

Without a validator, a browser cannot ask whether its stored copy is still current, so it downloads the whole response again once the copy expires. Only 2xx responses are checked.

Reported as

no ETag or Last-Modified to revalidate against

Fix

Add an ETag or Last-Modified header to the response.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers

Expects

{
  "anyOf": [
    {
      "required": [
        "etag"
      ]
    },
    {
      "required": [
        "last-modified"
      ]
    }
  ]
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 299
  }
}

http/vary-accept-encoding

A compressed response lacks Vary: Accept-Encoding

http/vary-accept-encoding/missing · warning · score 5.4 · page

Without it, a shared cache or CDN may store the compressed copy and hand it to a client that cannot decompress it, or the other way round. Only responses that declare a Content-Encoding are checked.

Reported as

a compressed response should carry Vary: Accept-Encoding

Fix

Add Vary: Accept-Encoding to the response.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.vary.value

Expects

{
  "type": "array",
  "contains": {
    "enum": [
      "accept-encoding",
      "*"
    ]
  }
}

When

{
  "http.headers.content-encoding": {
    "type": "string"
  },
  "http.parsed.vary.errors": {
    "maxItems": 0
  }
}

http/vary-star

Vary: * makes the response uncacheable

http/vary-star/present · warning · score 5.6 · page

A Vary of * tells caches that every request differs, so browsers and CDNs cannot reuse the response and every visit hits the server. Only responses that send a Vary header are checked.

Reported as

Vary: * makes the response uncacheable

Fix

Replace Vary: * with the specific header names the response varies by.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.vary.value

Expects

{
  "not": {
    "contains": {
      "const": "*"
    }
  }
}

When

{
  "http.parsed.vary.value": {
    "type": "array"
  }
}

http/vary

The Vary header is malformed

http/vary/invalid · warning · score 4.2 · page

Caches that cannot read Vary may serve the wrong variant of a page, such as the wrong language or compression, to a visitor. Only responses that send Vary are checked.

Reported as

Vary breaks RFC 9110 §12.5.5

Fix

List the request header names the response varies by, as in Vary: Accept-Encoding.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.parsed.vary.errors

Expects

{
  "maxItems": 0
}

When

{
  "http.parsed.vary": {
    "type": "object"
  }
}

http/version

The server answers over HTTP/1.1 instead of HTTP/2 or HTTP/3

http/version/outdated · warning · score 5.8 · page

HTTP/1.1 loads resources less efficiently, so pages take longer to appear, most of all on slow or lossy connections. Only responses that report a protocol version are checked.

Reported as

the server should speak HTTP/2 or HTTP/3

Fix

Enable HTTP/2 or HTTP/3 on the server.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.version

Expects

{
  "type": "string",
  "pattern": "^[23]"
}

When

{
  "http.version": {
    "type": "string"
  }
}

http/x-xss-protection

X-XSS-Protection is switched on

http/x-xss-protection/insecure · warning · score 4.5 · page

The old browser filter this header enables can itself introduce cross-site scripting holes, so the header should be absent or 0. Only responses that send it are checked.

Reported as

X-XSS-Protection should be absent or 0

Fix

Remove X-XSS-Protection.

Runs by default, in the recommended ruleset.

References

For rule authors

Reads

  • http.headers

Expects

{
  "properties": {
    "x-xss-protection": {
      "pattern": "^\\s*0\\s*$"
    }
  }
}

When

{
  "http.status": {
    "minimum": 200,
    "maximum": 499,
    "not": {
      "const": 429
    }
  }
}