Skip to content

waf-detect: read vendor cookie names, attribute a bot vendor over its CDN, and stop calling CloudFront AWS WAF #750

Closed

Description

@nc9

@squirrelscan/waf-detect misses or misnames bot-protection vendors in three common cases:

  1. Cookies are not read. Vendors set cookies whose NAMES identify them:

    • Cloudflare: __cf_bm, cf_clearance
    • DataDome: datadome
    • HUMAN/PerimeterX: _px3, _pxvid, ...
    • Kasada: KP_UIDz
    • Akamai Bot Manager: _abck, ak_bmsc, bm_sz
    • Imperva: incap_ses_*, visid_incap_*, reese84
    • AWS WAF: aws-waf-token

    A block page often carries the cookie and no vendor header.

  2. Stacked vendors are misattributed. Detection takes the first match in a fixed order and returns early on any high-confidence header, so a DataDome block served through Cloudflare (cf-ray plus DataDome's header, cookie or markup) is reported as Cloudflare.

  3. AWS infrastructure is reported as AWS WAF. x-amz-cf-id (CloudFront), x-amzn-requestid and x-amz-apigw-id (API Gateway, Lambda) appear on AWS-hosted sites that have no WAF. AWS WAF's own signals are the x-amzn-waf-action header, the aws-waf-token cookie and its *.token.awswaf.com challenge script.

The CLI's bot-protection warning and the WAF technology entry both read this package, so they inherit all three gaps.

Acceptance Criteria

  • A response that sets only a vendor cookie (no vendor header) is detected as that vendor, for each vendor listed above. Each has a fixture test.
  • Cookie values never appear in the detection result: names only.
  • A Cloudflare-fronted response with DataDome's header, cookie or block-page markup is attributed to DataDome.
  • The result still lists Cloudflare among the providers, so callers asking "did this come through Cloudflare?" keep answering yes.
  • CloudFront, API Gateway and Lambda headers alone are not AWS WAF; x-amzn-waf-action or the AWS WAF challenge script is.
  • A response with no known signature is not detected, never guessed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions