CVE-2023-46127
Frappe HTML Injection in desk
- CVSS 5.4
- CWE-79 Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')
- Input Validation and Sanitization
- Local
Frappe is a full-stack web application framework that uses Python and MariaDB on the server side and an integrated client side library. A malicious Frappe user with desk access could create documents containing HTML payloads allowing HTML Injection. This vulnerability has been patched in version 14.49.0.
- CVSS base score
- 5.4
- Published
- 2023-10-23
- OWASP
- A03 Injection
- Orthogonal defect classification
- Function
- Code defect classification
- Incorrect Functionality
- Category
- Input Validation and Sanitization
- Subcategory
- Command Injection
- Accessibility scope
- Local
- Impact
- Arbitrary Code Execution
- Fixed by upgrading
- Yes
Solution
Update Frappe to version 14.49.0 or higher.
Vulnerable code sample
def save_user_input(user_input):
"""Vulnerable function that demonstrates the security issue."""
document = {
'content': user_input
}
database.save(document)
user_input = '<script>alert("XSS")</script><p>Code Executed.</p>'
save_user_input(user_input)Patched code sample
import html
def save_user_input(user_input):
"""Secure function that fixes the vulnerability."""
sanitized_input = html.escape(user_input)
document = {
'content': sanitized_input
}
database.save(document)
user_input = '<script>alert("XSS")</script><p>Code Executed.</p>'
save_user_input(user_input)Cite this entry
@misc{vaitp:cve202346127,
title = {{Frappe HTML Injection in desk}},
author = {Bogaerts, Fr\'ed\'eric and Ivaki, Naghmeh and Fonseca, Jos\'e},
year = {2023},
note = {VAITP Python Vulnerability Dataset, entry CVE-2023-46127},
howpublished = {\url{https://netpack.pt/vaitp/vulnerability/CVE-2023-46127/}}
}
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 ::
