Skip to content

New rule: images/hotlinked - content images loaded from other sites' servers #932

Closed

Description

@nc9

Problem

Pages often load content images straight from another site's servers, for example logos from upload.wikimedia.org or images copied by URL from a supplier's or a news site's CDN. This is hotlinking. It causes three problems:

  • Reliability. The image breaks when the other site moves, renames, rate-limits or blocks hotlinking (many return a placeholder or a 403 when the referrer is foreign).
  • Performance. An extra DNS, TLS and connection setup to a host the page doesn't otherwise use, and no control over caching or format.
  • Licensing. Using someone else's bandwidth and, often, their copyrighted image.

Nothing reports this today. images/responsive-size skips third-party hosts, and images/optimized only knows image CDNs.

Proposal

New rule images/hotlinked, page scope, no network.

  • First-party hosts: the audited host, its subdomains, and hosts on the same registrable domain (cdn.example.com for example.com).
  • Allowlisted: known image CDNs and site-builder storage, used by the site on purpose:
    • Cloudinary, Imgix, Cloudflare Images, CloudFront
    • Shopify CDN, wp.com, Squarespace, Wix, Contentful, Sanity, Webflow
    • Reuse and extend the list in images/optimized.
    • Allow extension via rule options.
  • Warn: a content image (<img>, <picture> <source>, CSS background-image in inline styles) whose host is neither first-party nor allowlisted. Group by host: "6 images on 3 pages load from upload.wikimedia.org".
  • Info: the same for og:image and twitter:image. Platforms fetch those, so a broken hotlinked share image fails silently.
  • Skip:
    • tracking pixels (1x1, or known analytics hosts)
    • images inside third-party embeds (iframes)
    • avatars from Gravatar and similar services

Notes

  • Cost: URL parsing on data the crawl already has.
  • False-positive risk: medium on sites that use an unusual CDN. Rule options to add allowed hosts keep it manageable.

Acceptance Criteria

  • Fixture: an <img src="https://upload.wikimedia.org/..."> on example.com produces a warning naming the host and the pages
  • Fixture: images from cdn.example.com and res.cloudinary.com produce no finding
  • Fixture: a 1x1 tracking pixel from a third-party host produces no finding
  • A host added via rule options is treated as allowed
  • Findings are grouped per host, with affected pages listed
  • Docs page under docs/rules/images/, including the rule options

Activity

  1. added
    enhancement
    size: S
    rules
    on Oct 18, 2026
  2. nc9 commented on Oct 26, 2026

    @nc9
    ContributorAuthor

    Fixed in #1028 (main 6f383f0..f70b22e): images/hotlinked reports content images loaded from another site's server, as info. Ships in v0.0.135.

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

    enhancementrulessize: S

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions