FA-26886 / HTTP ranges / Open access
Multipart boundary parameter parsing: all control bytes are excluded from the delimiter · case 01
Multipart boundary parameter parsing: all control bytes are excluded from the delimiter.
ROOT CAUSE
The multipart-boundary-parameter-boundary-control decision uses parts=[] current='' quoted=False escaped=False for c in x: if escaped: current+=c escaped=False elif quoted and c=='\\': escaped=True elif c=='"': quoted=not quoted elif c==';' and not quoted: parts.append(current) current='' else: current+=c if quoted or escaped: return None parts.append(current) if parts[0].strip().lower()!='multipart/byteranges': return None boundaries=[] for part in parts[1:]: if '=' not in part: continue key,value=part.split('=',1) if key.strip().lower()=='boundary': boundaries.append(value.strip()) if len(boundaries)!=1: return None value=boundaries[0] if not 1<=len(value)<=12: return None if '\r' in value: return None return value.
THE FAILURE
The multipart-boundary-parameter-boundary-control decision uses parts=[] current='' quoted=False escaped=False for c in x: if escaped: current+=c escaped=False elif quoted and c=='\\': escaped=True elif c=='"': quoted=not quoted elif c==';' and not quoted: parts.append(current) current='' else: current+=c if quoted or escaped: return None parts.append(current) if parts[0].strip().lower()!='multipart/byteranges': return None boundaries=[] for part in parts[1:]: if '=' not in part: continue key,value=part.split('=',1) if key.strip().lower()=='boundary': boundaries.append(value.strip()) if len(boundaries)!=1: return None value=boundaries[0] if not 1<=len(value)<=12: return None if '\r' in value: return None return value.
Unsuccessful approach: The partial repair uses parts=[] current='' quoted=False escaped=False for c in x: if escaped: current+=c escaped=False elif quoted and c=='\\': escaped=True elif c=='"': quoted=not quoted elif c==';' and not quoted: parts.append(current) current='' else: current+=c if quoted or escaped: return None parts.append(current) if parts[0].strip().lower()!='multipart/byteranges': return None boundaries=[] for part in parts[1:]: if '=' not in part: continue key,value=part.split('=',1) if key.strip().lower()=='boundary': boundaries.append(value.strip()) if len(boundaries)!=1: return None value=boundaries[0] if not 1<=len(value)<=12: return None if '\r' in value or '\n' in value: return None return value, which still violates the stated contract.
Case contract
Parse a bounded Content-Type string with semicolon-separated parameters, quoted strings and backslash escapes inside quotes. Require multipart/byteranges (case-insensitive) and exactly one boundary parameter, with 1..12 ASCII printable characters excluding CR/LF. Other parameters ignored. Unbalanced quotes or dangling quoted escapes reject. Input x is the field string.
Why this case matters
Range responses combine representation identity, conditional requests, framing, and partial-object state.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
parts=[]
current=''
quoted=False
escaped=False
for c in x:
if escaped:
current+=c
escaped=False
elif quoted and c=='\\':
escaped=True
elif c=='"':
quoted=not quoted
elif c==';' and not quoted:
parts.append(current)
current=''
else:
current+=c
if quoted or escaped: return None
parts.append(current)
if parts[0].strip().lower()!='multipart/byteranges': return None
boundaries=[]
for part in parts[1:]:
if '=' not in part: continue
key,value=part.split('=',1)
if key.strip().lower()=='boundary': boundaries.append(value.strip())
if len(boundaries)!=1: return None
value=boundaries[0]
if not 1<=len(value)<=12: return None
if '\r' in value: return None
return value
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary-control fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('boundary-control fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('boundary-control fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('boundary-control fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('boundary-control fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('boundary-control fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('boundary-control fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('boundary-control fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('boundary-control fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('boundary-control fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('boundary-control fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('boundary-control fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('boundary-control fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('boundary-control fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('boundary-control fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('boundary-control fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('boundary-control fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('boundary-control fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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 |
|---|---|---|---|
| boundary-control fixture 0 | a;b | a;b | Passed |
| boundary-control fixture 1 | a"b | a"b | Passed |
| boundary-control fixture 2 | a\b | a\b | Passed |
| boundary-control fixture 3 | None | None | Passed |
| boundary-control fixture 4 | abc | abc | Passed |
| boundary-control fixture 5 | None | None | Passed |
| boundary-control fixture 6 | None | None | Passed |
| boundary-control fixture 7 | None | None | Passed |
| boundary-control fixture 8 | None | None | Passed |
| boundary-control fixture 9 | abcdefghijkl | abcdefghijkl | Passed |
| boundary-control fixture 10 | None | None | Passed |
| boundary-control fixture 11 | a
b | None | Failed |
| boundary-control fixture 12 | ab | None | Failed |
| boundary-control fixture 13 | None | None | Passed |
| boundary-control fixture 14 | None | None | Passed |
| boundary-control fixture 15 | b1 | b1 | Passed |
| boundary-control fixture 16 | abc | abc | Passed |
| boundary-control fixture 17 | ab | ab | Passed |
SHA-256 / 82ad04d4aa3832f0fa47acb65199031a7e94d32a9fa085688b450ae04a796a9b
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
parts=[]
current=''
quoted=False
escaped=False
for c in x:
if escaped:
current+=c
escaped=False
elif quoted and c=='\\':
escaped=True
elif c=='"':
quoted=not quoted
elif c==';' and not quoted:
parts.append(current)
current=''
else:
current+=c
if quoted or escaped: return None
parts.append(current)
if parts[0].strip().lower()!='multipart/byteranges': return None
boundaries=[]
for part in parts[1:]:
if '=' not in part: continue
key,value=part.split('=',1)
if key.strip().lower()=='boundary': boundaries.append(value.strip())
if len(boundaries)!=1: return None
value=boundaries[0]
if not 1<=len(value)<=12: return None
if '\r' in value or '\n' in value: return None
return value
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('boundary-control fixture 0', json.loads(json.dumps(solve('multipart/byteranges; boundary="a;b"'))), json.loads(json.dumps('a;b')))
check('boundary-control fixture 1', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\"b"'))), json.loads(json.dumps('a"b')))
check('boundary-control fixture 2', json.loads(json.dumps(solve('multipart/byteranges; boundary="a\\\\b"'))), json.loads(json.dumps('a\\b')))
check('boundary-control fixture 3', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc'))), json.loads(json.dumps(None)))
check('boundary-control fixture 4', json.loads(json.dumps(solve(' Multipart/ByteRanges ; BOUNDARY = abc '))), json.loads(json.dumps('abc')))
check('boundary-control fixture 5', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=a'))), json.loads(json.dumps(None)))
check('boundary-control fixture 6', json.loads(json.dumps(solve('multipart/byteranges; boundary=a; boundary=b'))), json.loads(json.dumps(None)))
check('boundary-control fixture 7', json.loads(json.dumps(solve('multipart/mixed; boundary=a'))), json.loads(json.dumps(None)))
check('boundary-control fixture 8', json.loads(json.dumps(solve('multipart/byteranges; boundary='))), json.loads(json.dumps(None)))
check('boundary-control fixture 9', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijkl'))), json.loads(json.dumps('abcdefghijkl')))
check('boundary-control fixture 10', json.loads(json.dumps(solve('multipart/byteranges; boundary=abcdefghijklm'))), json.loads(json.dumps(None)))
check('boundary-control fixture 11', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\nb'))), json.loads(json.dumps(None)))
check('boundary-control fixture 12', json.loads(json.dumps(solve('multipart/byteranges; boundary=a\x7fb'))), json.loads(json.dumps(None)))
check('boundary-control fixture 13', json.loads(json.dumps(solve('multipart/byteranges; x=y'))), json.loads(json.dumps(None)))
check('boundary-control fixture 14', json.loads(json.dumps(solve("p"*N))), json.loads(json.dumps(None)))
check('boundary-control fixture 15', json.loads(json.dumps(solve("multipart/byteranges; boundary=b"+str(N)))), json.loads(json.dumps("b"+str(N))))
check('boundary-control fixture 16', json.loads(json.dumps(solve('multipart/byteranges; boundary="abc"'))), json.loads(json.dumps('abc')))
check('boundary-control fixture 17', json.loads(json.dumps(solve('multipart/byteranges; x=a=b; boundary=ab'))), json.loads(json.dumps('ab')))
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 |
|---|---|---|---|
| boundary-control fixture 0 | a;b | a;b | Passed |
| boundary-control fixture 1 | a"b | a"b | Passed |
| boundary-control fixture 2 | a\b | a\b | Passed |
| boundary-control fixture 3 | None | None | Passed |
| boundary-control fixture 4 | abc | abc | Passed |
| boundary-control fixture 5 | None | None | Passed |
| boundary-control fixture 6 | None | None | Passed |
| boundary-control fixture 7 | None | None | Passed |
| boundary-control fixture 8 | None | None | Passed |
| boundary-control fixture 9 | abcdefghijkl | abcdefghijkl | Passed |
| boundary-control fixture 10 | None | None | Passed |
| boundary-control fixture 11 | None | None | Passed |
| boundary-control fixture 12 | ab | None | Failed |
| boundary-control fixture 13 | None | None | Passed |
| boundary-control fixture 14 | None | None | Passed |
| boundary-control fixture 15 | b1 | b1 | Passed |
| boundary-control fixture 16 | abc | abc | Passed |
| boundary-control fixture 17 | ab | ab | Passed |
SHA-256 / 2e546a3d730edf6ed88bd897dab2e02bd754bb5d315b1e84f4851cc163ad1e3b
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 18 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
Deterministic simplified range service, with stipulated local policies and already parsed trusted inputs; not a complete HTTP implementation. 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:41:20.007976+00:00.
Case digest / efe3414e26e61ea1a5ae312d69445b51235b949ec0d9e429561d0fd36f247850