Skip to content

security/x-frame-options reports nothing for an unrecognised X-Frame-Options value #1080

Closed

Description

@nc9

security/x-frame-options (packages/rules/src/security/x-frame-options.ts) emits no check at all when the header is present with a value other than DENY, SAMEORIGIN or one containing ALLOW-FROM. Examples: ALLOWALL, a typo such as DENNY, or a repeated header that arrives joined as DENY, DENY. Browsers ignore an invalid value, so the page can be framed, but the audit reports neither a warning nor a pass for it.

A second, smaller gap: frame-ancestors is detected with csp?.includes("frame-ancestors"), a substring test on the enforced policy, so a source value that merely contains the text counts.

Found while porting the header rules for the instant security headers check on squirrelscan.com (private #3121), which mirrors the current behaviour and shows "N/A" for such values.

Acceptance Criteria

  • An X-Frame-Options value other than DENY or SAMEORIGIN (case-insensitive, after trimming) and not ALLOW-FROM produces a warn check naming the value, unless CSP frame-ancestors already protects the page, in which case it passes via frame-ancestors
  • A repeated header joined as DENY, DENY or SAMEORIGIN, SAMEORIGIN is treated as that single value
  • frame-ancestors is detected as a parsed directive name, not a substring of the policy
  • Rule docs (docs/rules/security/x-frame-options.mdx) list the new message
  • Unit tests cover each case above

Activity

  1. added
    bug
    size: S
    rules
    security
    P2
    on Oct 23, 2026
  2. WilliamK112 commented on Oct 24, 2026

    @WilliamK112
    Contributor

    Update: I found that #1108 already covers this issue, so I will not submit a duplicate pull request.

  3. added a commit that references this issue on Oct 26, 2026
    66c0c05
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

    P2bugrulessecuritysize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions