FA-7681 / WebSocket and browser transport policies / Open access
Cors origin comparison includes scheme host and port · case 01
Cors origin comparison includes scheme host and port.
ROOT CAUSE
The faulty implementation uses `urlsplit(a).hostname == urlsplit(b).hostname` for the cors-origin-comparison-includes-scheme-host-and-port decision.
VERIFIED REPAIR
Apply the explicit cors-origin-comparison-includes-scheme-host-and-port contract, including the tested boundary and negative cases.
Unsuccessful approach: The attempted repair uses `a == b` and still violates a separate fixture.
Case contract
Bounded offline decision model: cors origin comparison includes scheme host and port. Inputs are already validated protocol fields; the explicit fixtures define the supported policy, not a complete protocol implementation.
Why this case matters
This deterministic websocket and browser transport policies model isolates the cors-origin-comparison-includes-scheme-host-and-port policy at a network component boundary.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(a, b):
return urlsplit(a).hostname == urlsplit(b).hostname
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('https://EXAMPLE:443', 'https://example:443'), True)", "check('fixture 2', solve('https://a:443', 'https://a:8443'), False)", "check('fixture 3', solve('http://a', 'https://a'), False)", "check('fixture 4', solve('https://a', 'https://a'), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
exec(_line)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 2 | True | False | Failed |
| fixture 3 | True | False | Failed |
| fixture 4 | True | True | Passed |
| fixture 1 | True | True | Passed |
SHA-256 / 4fdda2a7b0b5c9d745dace314b6dc1339b8b55687a4a074ff48500dfeb13f5c2
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(a, b):
return a == b
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('https://EXAMPLE:443', 'https://example:443'), True)", "check('fixture 2', solve('https://a:443', 'https://a:8443'), False)", "check('fixture 3', solve('http://a', 'https://a'), False)", "check('fixture 4', solve('https://a', 'https://a'), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
exec(_line)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 2 | False | False | Passed |
| fixture 3 | False | False | Passed |
| fixture 4 | True | True | Passed |
| fixture 1 | False | True | Failed |
SHA-256 / d11311357aec41d61cb0211d123461dd81bd4adac6c802fc92726bffc1252ffa
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import ipaddress
import re
from urllib.parse import urlsplit, urljoin
N = 1
observations = []
def solve(a, b):
return (urlsplit(a).scheme,urlsplit(a).hostname,urlsplit(a).port)==(urlsplit(b).scheme,urlsplit(b).hostname,urlsplit(b).port)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_fixtures = ["check('fixture 1', solve('https://EXAMPLE:443', 'https://example:443'), True)", "check('fixture 2', solve('https://a:443', 'https://a:8443'), False)", "check('fixture 3', solve('http://a', 'https://a'), False)", "check('fixture 4', solve('https://a', 'https://a'), True)"]
for _line in _fixtures[N % len(_fixtures):] + _fixtures[:N % len(_fixtures)]:
exec(_line)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 2 | False | False | Passed |
| fixture 3 | False | False | Passed |
| fixture 4 | True | True | Passed |
| fixture 1 | True | True | Passed |
SHA-256 / f32e929a13901eef790c572a43f811c6402017c9767009aad5e6129e504d1575
Verification & scope
Bounded deterministic policy model over validated inputs; not a complete protocol stack or an interoperability claim. The five variants rotate the same explicit fixture set. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.
Observations recorded using Python 3.12.14 at 2026-09-29T14:38:14.215044+00:00.
Case digest / 031d01febd37927f932fc912e9f209b5944a3763e48a6273eb5d156bbf52e248