Critical URI Sanitization Flaw in Bleach Package (CVE-2018-7753)

python-bleach Updated 02 Oct 2025

Summary

07/03/2018
N/A
Yes i
Critical
9.8

CVE-2018-7753: An issue was discovered in Bleach 2.1.x before 2.1.3. Affects python-bleach across 3 version ranges.

< 2.1.3-1 < 9584f42051c0039cb0f27a617e8ab3e945018cc6 < c5df5789ec3471a31311f42c2d19fc2cf21b35ef

Fixed in 2.1.3-1. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Mobile apps built by Devnack Design, build and launch iOS and Android apps with a senior product team. From idea to store release Start a project

Background

Bleach is a popular HTML sanitizing library for Python, designed to allow safe rendering of HTML content by removing potentially harmful elements. It is widely used in web applications to prevent XSS (Cross-Site Scripting) attacks. The vulnerability in question affects versions 2.1.x prior to 2.1.3, where attributes containing URI values were not properly sanitized, leading to potential security risks.

Vulnerability Detail

CVE-2018-7753 is a critical vulnerability that arises from improper sanitization of URI values in the Bleach library. Specifically, when character entities are used in URI attributes, they can bypass the sanitization process, allowing attackers to construct malicious URIs with unauthorized schemes. This flaw can lead to severe consequences, including unauthorized access and exploitation of web applications that rely on Bleach for HTML sanitization.

How To Fix

Minimum fixed version

2.1.3-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-bleach

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

If upgrading is not immediately possible, consider implementing additional validation on URI attributes within your application to ensure that only safe and expected schemes are allowed. This can be done by manually checking the URI values before processing them.

Conclusion

CVE-2018-7753 represents a significant security vulnerability in the Bleach library, affecting its ability to properly sanitize URI values. Users are strongly advised to upgrade to the latest version to mitigate risks. Additionally, implementing workarounds can provide temporary relief until an upgrade is feasible.

See every vulnerability recorded for python-bleach →

Share this vulnerability

FAQ

CVE-2018-7753 is a vulnerability in the Bleach library that allows improper sanitization of URI values, potentially leading to security risks.

Bleach versions 2.1.x before 2.1.3 are affected by this vulnerability.

Exploitation of this vulnerability can lead to unauthorized access and manipulation of web applications, posing significant security threats.

You can use Vulert's playground at Vulert Scanner to check if your application is affected by this vulnerability without any signup.

The CVSS score for CVE-2018-7753 is 9.8, indicating a critical level of severity.

Related vulnerabilities

Recent vulnerabilities recorded for python-bleach.

How To Fix

Minimum fixed version

2.1.3-1

This is the first release that contains the fix.

sudo apt-get install --only-upgrade python-bleach

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback