A user taps a link on a web page. Their phone opens an installed app — no chooser dialog, no warning — and the app loads a page inside its own WebView. The frame around that page belongs to the app. The branding belongs to the app. The page itself is on a domain the attacker registered that morning, and the WebView hands it the user's session cookies.
That is CVE-2026-65993, published in October 2026 against a widely installed, actively maintained open-source Android app. The deep-link handler validated the URI authority with String.endsWith(). There is no dot boundary in that call and no exact match, so evil-wikipedia.org passed the check. So did notwikipedia.org. The manifest declared the custom scheme with the BROWSABLE category and no host restriction, and the app was the only handler registered for that scheme — which is why Android launched it straight from the browser with nothing for the user to decline.
Then the part that made us rewrite a review checklist rather than file a ticket. The same codebase had a second suffix check, in the cookie layer, matching cookie domains with domain.endsWith(domainSpec). One bad check gets you an attacker's page inside trusted app chrome. The second one gets you the cookies: the username, a long-lived authentication token, and session tokens valid across the organisation's other sites. One mistake, written twice, in two components that were almost certainly reviewed by different people at different times.
If you build web rather than mobile, the same defect has a web-shaped CVE from the same year. CVE-2026-37737 covers a Python CORS library whose origin matcher calls re.match without end-anchoring, so https://trusted.com.attacker.io satisfies an allowlist entry for trusted.com and the browser is then told, with credentials, that the attacker's origin is permitted. It is filed under CWE-625, permissive regular expression, and CWE-346, origin validation error. That one is worth knowing about for a second reason: the library is unmaintained, its last release was in 2022, and as of this month there is no fixed version upstream and none coming. At least one downstream project's remediation was to delete the dependency and write the check in-tree.
The string is right and the host is wrong
The reason this bug class survives review is that the code reads correctly out loud. "Check the host ends with our domain" is a sentence a reviewer agrees with before they have finished reading it. The gap is that the sentence is about hosts and the code is about characters, and the domain name system does not care about characters. example.com is a label boundary, not a substring; the only things underneath it are example.com itself and names that end with a dot followed by it.
Which means an attacker's whole job is to find a registrable name that satisfies your string predicate. That search space is enormous and costs about ten dollars to act on. A suffix check hands them every prefix: evil-example.com, notexample.com, my-example.com. A prefix check hands them every subdomain of their own: example.com.attacker.io. A substring check hands them both. An unanchored regex is a substring check wearing a hat.
We now treat any of those four idioms applied to a hostname as a finding on sight, with no argument about whether this particular call site is reachable. Reachability changes, and the next person to touch the file will not re-derive the proof. The correct version is not more code either — it is a parse, a canonicalisation, and a set membership test, in that order.

Why review keeps passing it
We have reviewed a lot of other people's authentication code, and the honest summary is that nobody misses this because they do not know that evil-example.com exists. They miss it because of how the check gets read. It appears in a diff as one line in the middle of a routing function, it has a comment above it saying what it is supposed to do, and the test next to it asserts that app.example.com returns true and attacker.io returns false. Both assertions pass. Both are about the two cases that were already obvious.
So the fix in our process was not more security knowledge. It was taking the adversarial input set out of the reviewer's imagination and putting it in a file. The same seven hostile hosts, every time, for every host check in the codebase, whether it guards a deep link, a redirect, a CORS header or a cookie domain. A reviewer who has to ask "does this pass evil-example.com?" will get it right. A reviewer trying to invent evil-example.com on the spot, at the end of a long diff, will not.
“A host allowlist is not a string comparison with extra steps. It is a parser, a canonicaliser and a set membership test — and the bug is always one of the first two missing.”
It also changed what we ask for when we inherit a codebase. Grepping for the four idioms takes a minute and finds every call site, including the ones in the cookie layer that nobody thinks of as security code. That second finding in the Android chain is the whole reason to grep rather than to review the handler that was reported: the first bad check is usually the one with a CVE attached, and the second one is still sitting there.
What we require of a host check in review
- The URL is parsed before anything is compared. A raw string arriving from an intent, a query parameter or a header is not a URL yet, and every property worth checking — scheme, host, port, path — only exists after parsing. String operations on the raw value are how a path or a userinfo segment ends up being read as a host.
- The allowlist is data, not a predicate. A set of exact hosts that a non-specialist can read and audit, kept somewhere a reviewer will actually find it, beats a clever matcher every time. If the right answer genuinely needs a regex, it is anchored at both ends and someone has written down why.
- Subdomains are matched with a leading dot or not at all. The only safe suffix comparison is against a dot-prefixed domain, because the dot is the label boundary the string comparison was pretending to have.
- The same seven hostile hosts are asserted at every call site: a hyphen prefix, a no-separator prefix, the domain as a prefix of an attacker's domain, a trailing dot, mixed case, a punycode homoglyph, and the domain embedded in a path or userinfo segment. Seven table rows, reused everywhere. The point is that they are fixed, so nobody has to be inventive at review time.
- Each consumer validates for itself. The host check that guards navigation does not make the cookie jar, the WebView or the API client safe, because none of them call it. If a component makes a trust decision about an origin, it does the check — and that is a design constraint, not a code-review preference.
Validating the link once does not make the rest of the app safe
This is the part of the Android advisory that generalises furthest, and the reason we stopped describing these fixes as "fixing the deep-link handler". A single user action passed through several components that each made an independent trust decision about the same origin, and the handler was only the first of them. Fixing it would have closed the entry point and left the cookie exposure exactly where it was, waiting for the next component that forwards a URL.
- The intent filter— a custom scheme declared BROWSABLE with no host restriction is reachable from any web page. On Android, verified App Links are the mechanism that actually binds a host to your app; a bare custom scheme binds nothing, and the OS will not ask the user about it if you are the only handler registered for it.
- The handler— where the documented check usually lives, and the one that gets patched. Worth noting it is also the only one of these that a reader of the advisory will think to look at.
- The WebView’s own navigation— the first URL is yours to approve, and every redirect and in-page link after it is not.
shouldOverrideUrlLoadingis a separate decision point and needs the same allowlist, not a flag set earlier in the flow. - The cookie jar— domain matching is specified in RFC 6265, and the specified rule is not a suffix test. Reimplementing it with
endsWithis how a token scoped to one origin reaches another, and it fails independently of whether the navigation check was correct. - The API client— a base URL derived from whatever host the current page happens to be on will follow the attacker, bearer token attached. This one rarely looks like security code, which is why it survives the patch.
- The CORS policy on the server— the same comparison, written in a different language, reached by a different team, with the browser’s same-origin policy as the only thing standing behind it.
The cost of getting this wrong is not proportional to the size of the mistake, which is the argument we make to clients who would rather spend the sprint on features. The fix is one shared function and a test table. The failure is a long-lived credential sitting on somebody else's server, and there is no version of credential rotation that is cheaper than the afternoon it would have taken to write the function.

What we changed, and what it cost
Three things, and none of them took a week. We grep every codebase we inherit for the four idioms applied to a hostname, and treat each hit as a finding rather than a discussion. We keep one allowedHost function per service with the allowlist as data next to it, so there is exactly one place to be right. And we keep the hostile-host table in the repository and point every host check's tests at it, so adding a new case protects the call sites that already exist rather than only the one being written.
The reason to do this quarter rather than next is that the economics of finding these changed in 2026. The Android batch that produced that CVE was 24 vulnerabilities disclosed together, from an audit built around AI-assisted taskflows aimed at specific Android-shaped bug classes — host validation among them. Pattern-shaped defects in published code are now cheap to find at scale, and a suffix check on a hostname is about as pattern-shaped as a bug gets. The people running those sweeps against your app are not all going to send you an advisory first.
So the practice we dropped is reviewing an origin check by reading it, because it reads correctly when it is wrong. What replaced it is smaller than a policy: a parse, a set, a leading dot, and seven rows in a test table that nobody has to think of twice.









