Skip to content

fix(rules): security/hsts and security/x-frame-options use one check name for every outcome, so "missing" and "present but weak" cannot be told apart #1737

Closed

Description

@nc9

security/csp gives each outcome its own check name (csp-missing, csp-present, csp-report-only, csp-unsafe-scripts, csp-wildcard and so on). security/hsts and security/x-frame-options do not: every check either rule emits is named hsts or x-frame-options (seven each in packages/rules/src/security/hsts.ts and x-frame-options.ts), whatever it found.

A consumer that reads check names (report grouping, the cloud's recommendations, an agent reading the JSON report) therefore cannot tell a site with no HSTS header from a site whose header is present with a short max-age, or a missing X-Frame-Options from one that is set but overridden. The practical result is advice to "add HSTS" for a site that already sends it and only needs a longer max-age.

Expected: each distinct outcome has its own check name, as in security/csp.

Actual: one name per rule; only the message text differs.

Acceptance Criteria

  • security/hsts emits distinct check names for at least: header missing, header present and adequate, header present with too short a max-age, and any other warn outcome it has today (for example missing includeSubDomains where it reports that).
  • security/x-frame-options emits distinct check names for at least: no clickjacking protection, protected by X-Frame-Options, protected by CSP frame-ancestors, and a present but invalid value.
  • No two different outcomes of either rule share a check name; a test asserts this for both rules.
  • Existing check names that other code keys on are kept as the name of the closest outcome, or the change is listed in the CHANGELOG as a check rename.
  • The rule docs pages list the check names.

Activity

  1. added
    bug
    size: S
    rules
    security
    on Nov 11, 2026
  2. added theissue type on Nov 11, 2026
  3. nc9 commented on Nov 12, 2026

    @nc9
    ContributorAuthor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugrulessecuritysize: S

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions