CVE-2020-28473
Web Cache Poisoning in bottle < 0.12.19 via parameter cloaking
- CVSS 6.8
- CWE-444 Inconsistent Interpretation of HTTP Requests ('HTTP Request/Response Smuggling')
- Design Defects
- Remote
The package bottle from 0 and before 0.12.19 are vulnerable to Web Cache Poisoning by using a vector called parameter cloaking. When the attacker can separate query parameters using a semicolon (;), they can cause a difference in the interpretation of the request between the proxy (running with default configuration) and the server. This can result in malicious requests being cached as completely safe ones, as the proxy would usually not see the semicolon as a separator, and therefore would not include it in a cache key of an unkeyed parameter.
- CVSS base score
- 6.8
- Published
- 2021-01-18
- OWASP
- A06 Vulnerable and Outdated Components
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Design Defects
- Subcategory
- Security Misconfigurations
- Accessibility scope
- Remote
- Impact
- Unauthorized Access
- Affected component
- bottle
- Fixed by upgrading
- Yes
Solution
Update bottle to version 0.12.19 or higher.
Vulnerable code sample
from bottle import Bottle, request
app = Bottle()
@app.route('/example')
def example():
# Vulnerable to parameter cloaking
param1 = request.query.get('param1')
param2 = request.query.get('param2')
# No validation or sanitization of parameters
return f"Param1: {param1}, Param2: {param2}"
if __name__ == '__main__':
app.run(host='localhost', port=8080)Patched code sample
from bottle import Bottle, request, response
app = Bottle()
@app.route('/example')
def example():
# Get parameters from request
param1 = request.query.get('param1')
param2 = request.query.get('param2')
# Validate parameters to prevent caching issues
if param1 is None or param2 is None:
response.status = 400
return "Missing parameters"
# Process request safely
return f"Param1: {param1}, Param2: {param2}"
if __name__ == '__main__':
app.run(host='localhost', port=8080)Published fix
Public sources link this CVE to the changes below. The code samples above were generated to illustrate the defect; these links lead to the code the project actually changed.
- Do not split query strings on `;` anymore. (bottlepy/bottle)
bottle.py · _parse_qsl
Cite this entry
@misc{vaitp:cve202028473,
title = {{Web Cache Poisoning in bottle < 0.12.19 via parameter cloaking}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2021},
note = {VAITP Python Vulnerability Dataset, entry CVE-2020-28473},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2020-28473/}}
}
Introducing the "VAITP dataset": a specialized repository of Python vulnerabilities and patches, meticulously compiled for the use of the security research community. As Python's prominence grows, understanding and addressing potential security vulnerabilities become crucial. Crafted by and for the cybersecurity community, this dataset offers a valuable resource for researchers, analysts, and developers to analyze and mitigate the security risks associated with Python. Through the comprehensive exploration of vulnerabilities and corresponding patches, the VAITP dataset fosters a safer and more resilient Python ecosystem, encouraging collaborative advancements in programming security.
The supreme art of war is to subdue the enemy without fighting.
Sun Tzu – “The Art of War”
:: Shaping the future through research and ingenuity ::
