invalid x-timestamp causes 500
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Object Storage (swift) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Some invalid x-timestamp values reliably result in 500 series errors
Negative
=======
x-timestamp: -1
Jan 9 18:56:15 saio object-6020: ERROR __call__ error with PUT /sdb2/791/
Traceback (most recent call last):
File "/vagrant/
res = method(req)
File "/vagrant/
return func(*a, **kw)
File "/vagrant/
resp = func(ctrl, *args, **kwargs)
File "/vagrant/
headers=
AttributeError: 'int' object has no attribute 'internal' (txn: tx74090f8b66da4
From the proxies perspective it just can't seem to find an object-server that's willing to accept the request, after running out of handoffs it returns a server error to the client:
Jan 9 18:56:15 saio proxy-server: Object PUT returning 503, 0/2 required connections (txn: tx74090f8b66da4
(client_ip: 127.0.0.1)
Too big
======
x-timestamp: 1000000000000000
Jan 9 18:58:42 saio proxy-server: ERROR Unhandled exception in request:
Traceback (most recent call last):
File "/vagrant/
return handler(req)
File "/vagrant/
return func(*a, **kw)
File "/vagrant/
return func(*a, **kw)
File "/vagrant/
return func(*a, **kw)
File "/vagrant/
req, data_source, nodes, partition, outgoing_headers)
File "/vagrant/
float(
File "/vagrant/
"%a, %d %b %Y %H:%M:%S GMT", time.gmtime(value))
ValueError: (75, 'Value too large for defined data type') (txn: tx5e14516545f94
Surprisingly (?) the object-server is cool with this:
/srv/node2/
I'm not sure exactly what the largest value is anymore, we used to worry about fixed with floats for timestamps because of lexicographical ordering - I think *for now* we could realistically cap out a couple hundred years:
In [3]: print datetime.
2286-11-20 17:46:39.999990
we shouldn't return a 500 to the client
This bug concerns preventing the bad outcome
... I think we could wait for a use-case to discuss how/if we need/want to support dates before 1970 or after 2286
CVE References
summary: |
- missing x-timestamp validation + invalid x-timestamp causes 500 |
Changed in swift: | |
status: | New → Confirmed |
Reviewed: https:/ /review. openstack. org/265488 /git.openstack. org/cgit/ openstack/ swift/commit/ ?id=e6194113a3c 81563590eabf8f7 61ccb988bb917c
Committed: https:/
Submitter: Jenkins
Branch: master
commit e6194113a3c8156 3590eabf8f761cc b988bb917c
Author: Tim Burke <email address hidden>
Date: Fri Jan 8 16:38:31 2016 -0800
Validate X-Timestamps
Previously, attempting to PUT a new object with an X-Timestamp header
less than or equal to zero (ie, for a timestamp on or before 1970-01-01
00:00:00) would cause the object-server to 500.
While we're at it, cap X-Timestamp at 9999999999 (2286-11-20 17:46:40)
so we don't get an eleventh digit before the decimal point.
Closes-Bug: 1532471 29eaf9bfe54bd08 6c320b3429e
Change-Id: I23666ec8a067d8