Skip to content

Fix referrer_url#8

Merged
peterVorman merged 1 commit intomasterfrom
jguo144/2026-02-25/update-referrer_url
Feb 26, 2026
Merged

Fix referrer_url#8
peterVorman merged 1 commit intomasterfrom
jguo144/2026-02-25/update-referrer_url

Conversation

@jguo144
Copy link
Collaborator

@jguo144 jguo144 commented Feb 25, 2026

Description

When Cloudflare challenge are enabled, the browser's referrer chain is broken. A user navigating to the contact page can be intercepted by Cloudflare. After passing the challenge, referrer becomes /contact?__cf_chl_tk=... instead of the previously visited URL.

  • Add referrer_url as a query parameter to the contact form link
  • In the form() GET handler, the referrer is now resolved server-side with the explicit referrer_url query parameter
  • Added clean_referrer_url() function that strips any query parameter starting with _cf_chl from a URL, and returns empty string if the cleaned URL is just the contact page
  • The JS now only populates the referrer field if the server didn't provide a value

Copy link

@orca-security-us orca-security-us bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Orca Security Scan Summary

Status Check Issues by priority
Passed Passed Infrastructure as Code high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Secrets high 0   medium 0   low 0   info 0 View in Orca
Passed Passed Vulnerabilities high 0   medium 0   low 0   info 0 View in Orca

@peterVorman peterVorman merged commit e3a4ecb into master Feb 26, 2026
11 checks passed
@peterVorman peterVorman deleted the jguo144/2026-02-25/update-referrer_url branch February 26, 2026 06:35
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.

2 participants