Skip to content

Add rel=nofollow to external facing links on website#5219

Open
muratclk wants to merge 1 commit intogoogle:masterfrom
muratclk:add-nofollow-external-links
Open

Add rel=nofollow to external facing links on website#5219
muratclk wants to merge 1 commit intogoogle:masterfrom
muratclk:add-nofollow-external-links

Conversation

@muratclk
Copy link
Copy Markdown

@muratclk muratclk commented Apr 9, 2026

Summary

Adds rel="nofollow" to external-facing links on the OSV website to discourage search engine crawlers from promoting potentially malicious pages linked from vulnerability references.

Fixes #4644

Changes

Templates (gcp/website/frontend3/src/templates/)

  • vulnerability.html: Added nofollow to all data-driven links:
    • Source links (human_source_link, source_link)
    • Vulnerability reference URLs (reference.url)
    • Credit contact links
    • CVSS calculator links
    • Commit/version links in affected ranges
    • Package ecosystem links (package_in_ecosystem)
  • home.html: Added nofollow to third-party data source repository links (GitHub Advisory Database, PyPA, RustSec, Cloud Security Alliance)
  • linter/index.html: Added nofollow to external OSV-Linter tool link

Blog (gcp/website/blog/)

  • Added Hugo link render hook (layouts/_default/_markup/render-link.html) that automatically applies nofollow to external links in blog post markdown content

Trusted Domain Allowlist

The following domains are considered trusted and do not receive nofollow:

  • google.github.io (OSV docs, scanner docs)
  • ossf.github.io (OSV schema specification)
  • deps.dev (open source insights)
  • security.googleblog.com
  • github.com/google/* (Google repositories)
  • osv.dev / api.osv.dev

Test Plan

  • Verify vulnerability pages render with rel="nofollow noopener noreferrer" on reference URLs and source links
  • Verify trusted domain links (e.g., deps.dev, Google docs) do NOT have nofollow
  • Verify blog posts render external links with nofollow
  • Verify home page third-party links have nofollow

Add rel="nofollow" to external-facing links to discourage search engine
crawlers from promoting potentially malicious pages linked from
vulnerability references.

Changes:
- vulnerability.html: Add nofollow to all data-driven links (source
  links, references, CVSS calculators, commit links, package links,
  credit contacts)
- home.html: Add nofollow to third-party repository links
- linter/index.html: Add nofollow to external tool link
- blog: Add Hugo render hook to automatically apply nofollow to
  external links in blog post content

Trusted domains (deps.dev, google.github.io, ossf.github.io,
github.com/google/*, security.googleblog.com, osv.dev) are allowlisted
and do not receive nofollow.

Fixes google#4644
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add rel=nofollow to external facing links on website

1 participant