FA-27111 / HTTP ranges / Open access
A bounded Content-Range upload endpoint validates chunk admission: small chunks cannot evade the complete-object storage quota · case 01
A bounded Content-Range upload endpoint validates chunk admission: small chunks cannot evade the complete-object storage quota.
ROOT CAUSE
The ranged-upload-admission-whole-object-quota decision uses cells=dict(x['cells']) r=x['request'] if r['method']!='PUT': return ['method',sorted(cells.items())] if r['session']!=x['session']: return ['session',sorted(cells.items())] if r['generation']!=x['generation']: return ['generation',sorted(cells.items())] if r['total']!=x['total']: return ['total',sorted(cells.items())] if len(r['body'])>x['quota']: return ['quota',sorted(cells.items())] if r['start']<0 or r['stop']<r['start'] or r['stop']>r['total']: return ['bounds',sorted(cells.items())] if len(r['body'])!=r['stop']-r['start']: return ['length',sorted(cells.items())] if any(i in cells and cells[i]!=c for i,c in enumerate(r['body'],r['start'])): return ['conflict',sorted(cells.items())] for i,c in enumerate(r['body'],r['start']): cells[i]=c complete=set(cells)==set(range(x['total'])) return ['complete' if complete else 'partial',sorted(cells.items())].
VERIFIED REPAIR
Apply the bounded decision exactly: cells=dict(x['cells']) r=x['request'] if r['method']!='PUT': return ['method',sorted(cells.items())] if r['session']!=x['session']: return ['session',sorted(cells.items())] if r['generation']!=x['generation']: return ['generation',sorted(cells.items())] if r['total']!=x['total']: return ['total',sorted(cells.items())] if r['total']>x['quota']: return ['quota',sorted(cells.items())] if r['start']<0 or r['stop']<r['start'] or r['stop']>r['total']: return ['bounds',sorted(cells.items())] if len(r['body'])!=r['stop']-r['start']: return ['length',sorted(cells.items())] if any(i in cells and cells[i]!=c for i,c in enumerate(r['body'],r['start'])): return ['conflict',sorted(cells.items())] for i,c in enumerate(r['body'],r['start']): cells[i]=c complete=set(cells)==set(range(x['total'])) return ['complete' if complete else 'partial',sorted(cells.items())]
Unsuccessful approach: The partial repair uses cells=dict(x['cells']) r=x['request'] if r['method']!='PUT': return ['method',sorted(cells.items())] if r['session']!=x['session']: return ['session',sorted(cells.items())] if r['generation']!=x['generation']: return ['generation',sorted(cells.items())] if r['total']!=x['total']: return ['total',sorted(cells.items())] if r['stop']>x['quota']: return ['quota',sorted(cells.items())] if r['start']<0 or r['stop']<r['start'] or r['stop']>r['total']: return ['bounds',sorted(cells.items())] if len(r['body'])!=r['stop']-r['start']: return ['length',sorted(cells.items())] if any(i in cells and cells[i]!=c for i,c in enumerate(r['body'],r['start'])): return ['conflict',sorted(cells.items())] for i,c in enumerate(r['body'],r['start']): cells[i]=c complete=set(cells)==set(range(x['total'])) return ['complete' if complete else 'partial',sorted(cells.items())], which still violates the stated contract.
Case contract
This stipulated endpoint accepts PUT chunks against an upload session. Inputs include session ID, generation, declared complete length, [start,stop) byte span, ASCII body, and known committed cells. Return a disposition and updated cells; malformed metadata never mutates stored bytes. Exact duplicate chunks are idempotent, contradicting overlap is conflict, and quota concerns the complete representation rather than chunk size.
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):
cells=dict(x['cells'])
r=x['request']
if r['method']!='PUT': return ['method',sorted(cells.items())]
if r['session']!=x['session']: return ['session',sorted(cells.items())]
if r['generation']!=x['generation']: return ['generation',sorted(cells.items())]
if r['total']!=x['total']: return ['total',sorted(cells.items())]
if len(r['body'])>x['quota']: return ['quota',sorted(cells.items())]
if r['start']<0 or r['stop']<r['start'] or r['stop']>r['total']: return ['bounds',sorted(cells.items())]
if len(r['body'])!=r['stop']-r['start']: return ['length',sorted(cells.items())]
if any(i in cells and cells[i]!=c for i,c in enumerate(r['body'],r['start'])): return ['conflict',sorted(cells.items())]
for i,c in enumerate(r['body'],r['start']): cells[i]=c
complete=set(cells)==set(range(x['total']))
return ['complete' if complete else 'partial',sorted(cells.items())]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('whole-object-quota fixture 0', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[[0,'a']],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':1,'stop':3,'body':'bc'}}))), json.loads(json.dumps(['complete',[[0,'a'],[1,'b'],[2,'c']]])))
check('whole-object-quota fixture 1', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[[0,'a']],'request':{'method':'POST','session':'s','generation':2,'total':3,'start':1,'stop':2,'body':'b'}}))), json.loads(json.dumps(['method',[[0,'a']]])))
check('whole-object-quota fixture 2', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'other','generation':2,'total':3,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['session',[]])))
check('whole-object-quota fixture 3', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'s','generation':3,'total':3,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['generation',[]])))
check('whole-object-quota fixture 4', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':4,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['total',[]])))
check('whole-object-quota fixture 5', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':2,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['quota',[]])))
check('whole-object-quota fixture 6', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':-1,'stop':0,'body':'a'}}))), json.loads(json.dumps(['bounds',[]])))
check('whole-object-quota fixture 7', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':1,'stop':3,'body':'b'}}))), json.loads(json.dumps(['length',[]])))
check('whole-object-quota fixture 8', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[[0,'a']],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':0,'stop':1,'body':'x'}}))), json.loads(json.dumps(['conflict',[[0,'a']]])))
check('whole-object-quota fixture 9', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[[0,'a']],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['partial',[[0,'a']]])))
check('whole-object-quota fixture 10', json.loads(json.dumps(solve({'session':'s','generation':2,'total':N,'quota':10,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':N,'start':0,'stop':N,'body':"p"*N}}))), json.loads(json.dumps(['complete',[[i,"p"] for i in range(N)]])))
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 |
|---|---|---|---|
| whole-object-quota fixture 0 | ['complete', [[0, 'a'], [1, 'b'], [2, 'c']]] | ['complete', [[0, 'a'], [1, 'b'], [2, 'c']]] | Passed |
| whole-object-quota fixture 1 | ['method', [[0, 'a']]] | ['method', [[0, 'a']]] | Passed |
| whole-object-quota fixture 2 | ['session', []] | ['session', []] | Passed |
| whole-object-quota fixture 3 | ['generation', []] | ['generation', []] | Passed |
| whole-object-quota fixture 4 | ['total', []] | ['total', []] | Passed |
| whole-object-quota fixture 5 | ['partial', [[0, 'a']]] | ['quota', []] | Failed |
| whole-object-quota fixture 6 | ['bounds', []] | ['bounds', []] | Passed |
| whole-object-quota fixture 7 | ['length', []] | ['length', []] | Passed |
| whole-object-quota fixture 8 | ['conflict', [[0, 'a']]] | ['conflict', [[0, 'a']]] | Passed |
| whole-object-quota fixture 9 | ['partial', [[0, 'a']]] | ['partial', [[0, 'a']]] | Passed |
| whole-object-quota fixture 10 | ['complete', [[0, 'p']]] | ['complete', [[0, 'p']]] | Passed |
SHA-256 / 7cd34ca26db4e8d95e7843fd9911eb24e7aeb773ad1b14a1ecc89c62d140bb1e
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
cells=dict(x['cells'])
r=x['request']
if r['method']!='PUT': return ['method',sorted(cells.items())]
if r['session']!=x['session']: return ['session',sorted(cells.items())]
if r['generation']!=x['generation']: return ['generation',sorted(cells.items())]
if r['total']!=x['total']: return ['total',sorted(cells.items())]
if r['stop']>x['quota']: return ['quota',sorted(cells.items())]
if r['start']<0 or r['stop']<r['start'] or r['stop']>r['total']: return ['bounds',sorted(cells.items())]
if len(r['body'])!=r['stop']-r['start']: return ['length',sorted(cells.items())]
if any(i in cells and cells[i]!=c for i,c in enumerate(r['body'],r['start'])): return ['conflict',sorted(cells.items())]
for i,c in enumerate(r['body'],r['start']): cells[i]=c
complete=set(cells)==set(range(x['total']))
return ['complete' if complete else 'partial',sorted(cells.items())]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('whole-object-quota fixture 0', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[[0,'a']],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':1,'stop':3,'body':'bc'}}))), json.loads(json.dumps(['complete',[[0,'a'],[1,'b'],[2,'c']]])))
check('whole-object-quota fixture 1', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[[0,'a']],'request':{'method':'POST','session':'s','generation':2,'total':3,'start':1,'stop':2,'body':'b'}}))), json.loads(json.dumps(['method',[[0,'a']]])))
check('whole-object-quota fixture 2', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'other','generation':2,'total':3,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['session',[]])))
check('whole-object-quota fixture 3', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'s','generation':3,'total':3,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['generation',[]])))
check('whole-object-quota fixture 4', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':4,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['total',[]])))
check('whole-object-quota fixture 5', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':2,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['quota',[]])))
check('whole-object-quota fixture 6', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':-1,'stop':0,'body':'a'}}))), json.loads(json.dumps(['bounds',[]])))
check('whole-object-quota fixture 7', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':1,'stop':3,'body':'b'}}))), json.loads(json.dumps(['length',[]])))
check('whole-object-quota fixture 8', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[[0,'a']],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':0,'stop':1,'body':'x'}}))), json.loads(json.dumps(['conflict',[[0,'a']]])))
check('whole-object-quota fixture 9', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[[0,'a']],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['partial',[[0,'a']]])))
check('whole-object-quota fixture 10', json.loads(json.dumps(solve({'session':'s','generation':2,'total':N,'quota':10,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':N,'start':0,'stop':N,'body':"p"*N}}))), json.loads(json.dumps(['complete',[[i,"p"] for i in range(N)]])))
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 |
|---|---|---|---|
| whole-object-quota fixture 0 | ['complete', [[0, 'a'], [1, 'b'], [2, 'c']]] | ['complete', [[0, 'a'], [1, 'b'], [2, 'c']]] | Passed |
| whole-object-quota fixture 1 | ['method', [[0, 'a']]] | ['method', [[0, 'a']]] | Passed |
| whole-object-quota fixture 2 | ['session', []] | ['session', []] | Passed |
| whole-object-quota fixture 3 | ['generation', []] | ['generation', []] | Passed |
| whole-object-quota fixture 4 | ['total', []] | ['total', []] | Passed |
| whole-object-quota fixture 5 | ['partial', [[0, 'a']]] | ['quota', []] | Failed |
| whole-object-quota fixture 6 | ['bounds', []] | ['bounds', []] | Passed |
| whole-object-quota fixture 7 | ['length', []] | ['length', []] | Passed |
| whole-object-quota fixture 8 | ['conflict', [[0, 'a']]] | ['conflict', [[0, 'a']]] | Passed |
| whole-object-quota fixture 9 | ['partial', [[0, 'a']]] | ['partial', [[0, 'a']]] | Passed |
| whole-object-quota fixture 10 | ['complete', [[0, 'p']]] | ['complete', [[0, 'p']]] | Passed |
SHA-256 / 9c1270b0647686dc6198bb7c09b1caf67006347037dabf5d1a9cd0d5e1938cc7
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(x):
cells=dict(x['cells'])
r=x['request']
if r['method']!='PUT': return ['method',sorted(cells.items())]
if r['session']!=x['session']: return ['session',sorted(cells.items())]
if r['generation']!=x['generation']: return ['generation',sorted(cells.items())]
if r['total']!=x['total']: return ['total',sorted(cells.items())]
if r['total']>x['quota']: return ['quota',sorted(cells.items())]
if r['start']<0 or r['stop']<r['start'] or r['stop']>r['total']: return ['bounds',sorted(cells.items())]
if len(r['body'])!=r['stop']-r['start']: return ['length',sorted(cells.items())]
if any(i in cells and cells[i]!=c for i,c in enumerate(r['body'],r['start'])): return ['conflict',sorted(cells.items())]
for i,c in enumerate(r['body'],r['start']): cells[i]=c
complete=set(cells)==set(range(x['total']))
return ['complete' if complete else 'partial',sorted(cells.items())]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('whole-object-quota fixture 0', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[[0,'a']],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':1,'stop':3,'body':'bc'}}))), json.loads(json.dumps(['complete',[[0,'a'],[1,'b'],[2,'c']]])))
check('whole-object-quota fixture 1', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[[0,'a']],'request':{'method':'POST','session':'s','generation':2,'total':3,'start':1,'stop':2,'body':'b'}}))), json.loads(json.dumps(['method',[[0,'a']]])))
check('whole-object-quota fixture 2', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'other','generation':2,'total':3,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['session',[]])))
check('whole-object-quota fixture 3', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'s','generation':3,'total':3,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['generation',[]])))
check('whole-object-quota fixture 4', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':4,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['total',[]])))
check('whole-object-quota fixture 5', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':2,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['quota',[]])))
check('whole-object-quota fixture 6', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':-1,'stop':0,'body':'a'}}))), json.loads(json.dumps(['bounds',[]])))
check('whole-object-quota fixture 7', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':1,'stop':3,'body':'b'}}))), json.loads(json.dumps(['length',[]])))
check('whole-object-quota fixture 8', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[[0,'a']],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':0,'stop':1,'body':'x'}}))), json.loads(json.dumps(['conflict',[[0,'a']]])))
check('whole-object-quota fixture 9', json.loads(json.dumps(solve({'session':'s','generation':2,'total':3,'quota':5,'cells':[[0,'a']],'request':{'method':'PUT','session':'s','generation':2,'total':3,'start':0,'stop':1,'body':'a'}}))), json.loads(json.dumps(['partial',[[0,'a']]])))
check('whole-object-quota fixture 10', json.loads(json.dumps(solve({'session':'s','generation':2,'total':N,'quota':10,'cells':[],'request':{'method':'PUT','session':'s','generation':2,'total':N,'start':0,'stop':N,'body':"p"*N}}))), json.loads(json.dumps(['complete',[[i,"p"] for i in range(N)]])))
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 |
|---|---|---|---|
| whole-object-quota fixture 0 | ['complete', [[0, 'a'], [1, 'b'], [2, 'c']]] | ['complete', [[0, 'a'], [1, 'b'], [2, 'c']]] | Passed |
| whole-object-quota fixture 1 | ['method', [[0, 'a']]] | ['method', [[0, 'a']]] | Passed |
| whole-object-quota fixture 2 | ['session', []] | ['session', []] | Passed |
| whole-object-quota fixture 3 | ['generation', []] | ['generation', []] | Passed |
| whole-object-quota fixture 4 | ['total', []] | ['total', []] | Passed |
| whole-object-quota fixture 5 | ['quota', []] | ['quota', []] | Passed |
| whole-object-quota fixture 6 | ['bounds', []] | ['bounds', []] | Passed |
| whole-object-quota fixture 7 | ['length', []] | ['length', []] | Passed |
| whole-object-quota fixture 8 | ['conflict', [[0, 'a']]] | ['conflict', [[0, 'a']]] | Passed |
| whole-object-quota fixture 9 | ['partial', [[0, 'a']]] | ['partial', [[0, 'a']]] | Passed |
| whole-object-quota fixture 10 | ['complete', [[0, 'p']]] | ['complete', [[0, 'p']]] | Passed |
SHA-256 / 985026a7468111597fd7f67e3cced38266398ff61d0e413e68b6a4bb71a9302f
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:22.158521+00:00.
Case digest / 8f239f21ff15f78605b32a4457b94c1797c6f10e9f1e3d841ded12011d924165