scheduler hints are unbounded and never deleted
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
OpenStack Compute (nova) |
In Progress
|
Undecided
|
Unassigned | ||
OpenStack Security Advisory |
Won't Fix
|
Undecided
|
Unassigned | ||
OpenStack Security Notes |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
I'm initially reporting this as a potential security issue but it might not be, I'm just looking for feedback from the VMT.
The scheduler_hints in the compute API are stored in the request_specs.spec column in the nova_api database:
https:/
There is no limit on the size of the keys or values, or number of hints, in the API:
There are some pre-defined hints, but additionalPrope
So I could boot a server with a scheduler_hints dict that has a million keys which are a million characters long. At best that just results in a 500 because the column size limit in the database rejects the json blob size. According to the mysql 5.7 docs:
https:/
"TEXT[(M)] [CHARACTER SET charset_name] [COLLATE collation_name]
A TEXT column with a maximum length of 65,535 (216 − 1) characters. The effective maximum length is less if the value contains multibyte characters. Each TEXT value is stored using a 2-byte length prefix that indicates the number of bytes in the value."
At worst, I'm able to work backward from a million until I found out the limit at which I can fill the request_specs.spec column and then just hammer the compute API, filling up the nova_api database.
So there are two issues:
1. No key/value size limit in the API json schema for scheduler hints.
2. No quota limit on the number of hints one can provide (unlike quota limits on user-provided metadata key/value pairs which are limited to 255 for the key/value and 128 for the quota).
Add to this the fact that we never delete request_specs entries from the nova_api database automatically (that's being worked on here: https:/
This might not be a security issue, it might just be poor API design and we can tighten things up to avoid a 500 error with quota limits and json schema validation on the key/value size on each hint, and also delete request specs when we delete an instance.
Changed in ossn: | |
status: | New → Won't Fix |
Changed in nova: | |
status: | New → In Progress |
For reference, here is the nova API subteam meeting log where this came up:
http:// eavesdrop. openstack. org/meetings/ nova_api/ 2017/nova_ api.2017- 03-15-13. 00.log. html