Loggerhead XSS via filename
Summary
CVE-2011-0728: Loggerhead XSS via filename. Affects loggerhead versions < 1.18.1. Fixed in 1.18.1. How to fix ↓
Also tracked for
- loggerhead · Debian:11
The same CVE-2011-0728 is tracked separately for each ecosystem and vendor. Its fix information is the same; the package and affected versions differ.
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
Loggerhead is a package available on PyPI that provides a web interface for browsing and viewing revisions of a code repository. It allows users to navigate through different versions of a project and view the changes made in each revision. However, an XSS vulnerability was discovered in Loggerhead before version 1.18.1. This vulnerability allows remote authenticated users to inject arbitrary web script or HTML through a filename, which is not properly handled in a revision view.
Vulnerability Detail
The XSS vulnerability in Loggerhead arises from a lack of proper input sanitization in the templatefunctions.py file. When a user provides a filename that contains malicious script or HTML code, it is not adequately filtered or escaped before being displayed in the revision view. This allows an attacker to inject arbitrary code that will be executed in the context of other users accessing the affected page. The impact of this vulnerability can range from defacement of the website to stealing sensitive information or performing actions on behalf of the user.
How To Fix
Latest published version: 2.0.3 as of 23 Oct 2026
pip install --upgrade "loggerhead==2.0.3"
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
1.18.1
This is the first release that contains the fix.
pip install --upgrade "loggerhead==1.18.1"
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Workaround
If upgrading to the latest version is not immediately feasible, a temporary workaround can be implemented by manually sanitizing the user-provided filename before displaying it in the revision view. This can be done by using a library or function that escapes or removes any potentially malicious characters or tags from the filename. Here is an example of how this can be achieved in Python:
import html
filename = user_input_filename
sanitized_filename = html.escape(filename)
# Display sanitized_filename in the revision view
This workaround should be considered temporary and upgrading to the latest version is still strongly recommended.
Conclusion
In conclusion, the Loggerhead package before version 1.18.1 is vulnerable to an XSS attack through a filename parameter. This can allow remote authenticated users to inject arbitrary web script or HTML, potentially leading to various security risks. It is crucial to upgrade to the latest version of Loggerhead or apply the provided workaround to mitigate this vulnerability. For further assistance or support in vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for loggerhead →
FAQ
Loggerhead is a package available on PyPI that provides a web interface for browsing and viewing revisions of a code repository. It allows users to navigate through different versions of a project and view the changes made in each revision.
Cross-site scripting (XSS) is a type of security vulnerability that allows attackers to inject malicious scripts or HTML code into web pages viewed by other users. This can lead to various consequences, such as stealing sensitive information, defacing websites, or performing actions on behalf of the user.
The XSS vulnerability in Loggerhead occurs when a user provides a filename that contains malicious script or HTML code. This input is not properly sanitized before being displayed in the revision view, allowing the injected code to be executed in the context of other users accessing the affected page.
The impact of the Loggerhead XSS vulnerability can range from defacement of the website to stealing sensitive information or performing actions on behalf of the user. An attacker can exploit this vulnerability to inject arbitrary code that will be executed in the context of other users, potentially leading to further compromise of the system.
To fix the Loggerhead XSS vulnerability, it is recommended to upgrade to version 1.18.1 or later. This version includes the necessary fixes to properly sanitize user input and prevent XSS attacks. Upgrading can be done by updating the package using the package manager or by manually downloading and installing the latest version from the PyPI repository.
Related vulnerabilities
Recent vulnerabilities recorded for loggerhead.