Enterprise Policy WebsiteFilter block bypassed by trailing-dot FQDN in Firefox
Firefox's enterprise WebsiteFilter policy compares blocked hosts by exact byte match, so a hostname written with a trailing dot is treated as a different host and the block is not applied. A managed user, or web content that links or redirects to the dotted form, can therefore load a site the administrator blocked.
Originally disclosed on Mozilla
- Fixed in 28 days
- Paid in 3 months
- Disclosed after 28 days
- Affected: Firefox with Enterprise Policies enabled —
WebsiteFilterBlockenforcement. Confirmed: Nightly 153.0a1 + mozilla-central HEAD 5836a06272 (static analysis + local runtime). Likely but not independently tested: other release/beta/ESR channels sharing the sameWebsiteFilter.sys.mjs→MatchPatternSet→MatchesDomain(aURL.Host())path. - Severity: CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:N/I:L/A:N (4.3 Medium)
- CVE: not-requested
- CWE: CWE-1289 (Improper Validation of Unsafe Equivalence in Input), CWE-863 (Incorrect Authorization)
Overview
The WebsiteFilter enterprise policy lets an administrator block navigation to a list of sites (Block: ["*://example.org/*", ...]). The block decision matches the page host against the policy patterns using MatchPattern's host comparison, which lower-cases the host but does not canonicalise the trailing-dot (fully-qualified) form. Because Gecko's URL parser preserves a trailing dot as a distinct host, navigating to the trailing-dot variant (https://example.org./) evades a host-specific Block entry and loads a site the administrator blocked.
Impact
A user (or web content via a link/redirect) bypasses an administrator-enforced WebsiteFilter block by appending a single dot to the hostname:
- Managed/parental-control/corporate deployments that block specific sites with
WebsiteFilter.Blockare evaded — the blocked site loads at its trailing-dot variant. The trailing-dot form is the DNS root-label spelling of the same fully-qualified name, so it resolves to and is served by the same host; Firefox's URL host serialization preserves it as a distinct host string and the block comparison never folds the two together. - Redirect-based blocks are equally evadable (
WebsiteFilter.observereuses the sameisAllowedfor 30xLocation).
Scope bound (stated honestly): this affects host-specific Block entries (the documented common usage, e.g. *://example.org/*). An allow-list deployment using <all_urls> / *://*/* is NOT bypassed, because MatchPattern's DomainIsWildcard (empty host) matches every host including the dotted one. The precondition is an enterprise WebsiteFilter policy; the "attacker" is whoever the policy is meant to restrain — the managed user appends the dot directly, or remote web content presents a dotted link / triggers a redirect that the user follows. This sits within the same Enterprise Policies security boundary as the Firefox 151 fix CVE-2026-8957, but is a separate trailing-dot host-canonicalisation issue in WebsiteFilter/MatchPattern, not a variant of that bug.
Technical Details
The block match does not canonicalise the trailing dot
browser/components/enterprisepolicies/helpers/WebsiteFilter.sys.mjs:161-171—shouldLoad → isAllowed → _blockPatterns.matches(url). The patterns are aMatchPatternSet.toolkit/components/extensions/MatchPattern.cpp:512MatchPatternSetCore::Matches→:407 MatchesDomain(aURL.Host()).URLInfo::Host()(MatchPattern.cpp:130-134) returnsnsIURI::GetHost()verbatim, andMatchesDomain(:370-384) ismDomain == aDomain— a raw byte comparison. The only normalisation WebsiteFilter applies is.toLowerCase()(WebsiteFilter.sys.mjs:53,69,110,162), which fixes case but not the trailing dot.- Gecko does have trailing-dot-aware host code elsewhere, which throws the gap into relief:
nsEffectiveTLDService::GetBaseDomainInternaltemporarily chomps a trailing dot before the public-suffix-list lookup (nsEffectiveTLDService.cpp:295-299) but then re-appends it to the value it returns (:450-453, and the cache-hit path:318-321). So even the eTLD service deliberately preserveshost.as distinct fromhostrather than normalising them — the trailing dot is a recognised hostname-canonicalisation concern in Gecko.WebsiteFilter's block comparison, by contrast, applies no canonical form at all: neitherWebsiteFilter.sys.mjsnorMatchPattern.cppstrips or folds the root-label dot before the byte compare (verified: 0EffectiveTLD/GetBaseDomainreferences on the match path). The bypass therefore rests on DNS root-label equivalence (host.andhostare the same DNS name reaching the same server), not on any claim that Gecko normalises the two. - Parse-time host handling (
nsStandardURL::NormalizeIDN→NS_DomainToASCII→ Rust idna UTS-46,idna_glue/src/lib.rs) preserves the trailing dot (empty root label), soGetHost()returnsexample.org.for inputhttps://example.org./.
So MatchesDomain("example.org", "example.org.") is false (exact byte compare), the dotted host falls outside the block patterns, and isAllowed returns true.
No test coverage
toolkit/components/extensions/test/.../test_MatchPattern.js has 0 trailing-dot host cases (the gap is untested).
Reproduction
This is an enterprise-policy target; the PoC is a managed-Firefox config + a navigation. Fully local (a host mapped to 127.0.0.1, no production traffic), run on the affected build.
Step 1 — Apply a host-specific WebsiteFilter block
<firefox>/distribution/policies.json (with MOZ_ENABLE_ENTERPRISE_POLICIES=1):
{ "policies": { "WebsiteFilter": { "Block": ["*://wftest.example/*"] } } }
Step 2 — Observe the bypass (end-to-end runtime verification)
Point both wftest.example and its trailing-dot form at a loopback HTTP test server entirely from Firefox prefs — no hosts file or external DNS needed — by setting network.dns.localDomains = "wftest.example,wftest.example." (with network.dns.native_is_localhost = false so the names are not treated as localhost) so both resolve to the local server. With the Step 1 Block: ["*://wftest.example/*"] policy active, launch the managed Firefox at each host and watch which page requests reach the server. Recorded on Nightly 153.0a1 (the server logs the page request only when the navigation is NOT blocked):
visit wftest.example -> server_request=0 -> BLOCKED (policy works)
visit wftest.example. -> server_request=1 -> LOADED (block BYPASSED via trailing dot)
The control host is correctly blocked (no request reaches the server); the trailing-dot variant of the same blocked host loads and fetches the page.
Step 3 — Confirm the dotted host loads + is a distinct host (page console)
Run in the DevTools console of the loaded trailing-dot page (the page that the block was supposed to stop). The page-context fetch() to its own origin succeeds — proving the document loaded past the block — and the URL check shows the host is the distinct dotted form:
// Run in the (should-have-been-blocked) page's DevTools console — local lab origin, read-only
fetch("/p.html")
.then((r) => console.log(
"blocked page loaded anyway:", r.ok,
"| host:", location.host, // ends in a literal "."
"| distinct from bare host:",
new URL("https://x.example./").host !== new URL("https://x.example/").host // true
));
Step 4 — Internal decision-function confirmation (privileged chrome context)
Confirmed directly against the matcher the WebsiteFilter uses — no network, no web content — in a privileged context (Marionette chrome context launched with -remote-allow-system-access, or the Browser Toolbox). Recorded on Nightly 153.0a1:
// chrome context (system principal)
const set = new MatchPatternSet(["*://accounts.firefox.com/*"]); // a host-specific Block pattern
set.matches("https://accounts.firefox.com/"); // true — bare host matches (would be blocked)
set.matches("https://accounts.firefox.com./"); // false — trailing-dot host does NOT match (BYPASS)
new MatchPatternSet(["<all_urls>"]).matches("https://accounts.firefox.com./"); // true — an <all_urls> Block is NOT bypassed (scoping: host-specific entries only)
The same MatchPatternSet the WebsiteFilter calls returns false for the trailing-dot URL while <all_urls> returns true — confirming both the bypass at the exact matcher and its scope (host-specific Block entries only; allow-list *://*/* deployments are unaffected).
The matcher keys on the asciiHost, so the block is also evaded by any input the URL parser normalises to host. — the percent-encoded %2e and the visible Unicode full-stops 。 (U+3002) / . (U+FF0E) / 。 (U+FF61) (UTS-46 maps each to .), all confirmed matches()===false against a host-specific Block pattern on Nightly 153.0a1.
Suggested Fix
Canonicalise the host (strip a single trailing dot) before the block comparison — either in WebsiteFilter's pattern/URL handling, or (preferably, fixing the whole class) in MatchPatternCore's host matching (MatchPattern.cpp URLInfo::Host/MatchesDomain), mirroring the pre-lookup dot chomp in nsEffectiveTLDService.cpp:295-299. Because MatchPatternCore::MatchesDomain is shared by other security-relevant consumers (e.g. WebExtension domain restrictions), a single canonicalisation fix at the matcher would close the broader trailing-dot class — those other consumers are tracked under separate reports and are out of scope here. Add trailing-dot host cases to test_MatchPattern.js.
Disclosure Timeline
- 2026-06-03: Discovered via source audit (trailing-dot host-canonicalisation class sweep) + local end-to-end verification.
- 2026-06-03: Reported via Mozilla security (maintainer-direct).
References
- WebsiteFilter policy: https://mozilla.github.io/policy-templates/#websitefilter
- Firefox 151 Enterprise-Policies fix: CVE-2026-8957 (MFSA 2026-46).
- Related trailing-dot host-canonicalisation instances (reported separately): WebExtension restricted/quarantined-domains content-script bypass (same
MatchPatternmatcher); PermissionManager deny-bypass (also reached by enterpriseCookies.Block/Permissions.*.Block/PasswordManagerExceptions).
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
The host comparison used by WebsiteFilter does not canonicalise the trailing-dot (fully-qualified) form of a hostname before comparing it to the block patterns.
Impact
Users under a host-specific WebsiteFilter block can reach blocked sites via the trailing-dot form, including through links or redirects, though allow-list deployments using wildcard patterns are not affected.
What the attacker needed
Enterprise WebsiteFilter policy enabled; host-specific Block entry, not wildcard; user follows dotted link or types it
The fix
The host should be canonicalised by stripping a single trailing dot before the block comparison, ideally inside the shared matcher, and trailing-dot test cases should be added.
How it was found
- Add a host-specific WebsiteFilter Block entry to the managed Firefox policies file.
- Map both the bare and trailing-dot hostnames to a local test server using Firefox DNS preferences.
- Visit the bare host and confirm the request never reaches the server (blocked).
- Visit the trailing-dot host and confirm the page request reaches the server (block bypassed).
- In a privileged context, check that the matcher returns true for the bare host and false for the dotted host.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
Some organisations use Firefox settings to stop staff or children opening certain websites. The check compares the site name letter for letter, and a name ending in a dot is technically the same site but a different string, so the check misses it. The blocked page then opens normally.
What is Access control?
A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.