# mozilla/bleach

Bleach is an allowed-list-based HTML sanitizing library that escapes or strips markup and attributes

Repository: https://github.com/mozilla/bleach
Canonical: https://ross.abutalabs.com/products/bleach
Homepage: https://bleach.readthedocs.io/en/latest/
Language: Python
License: NOASSERTION
License Family: other
Archived: true
Last push: 2026-06-05T13:02:39+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 86, release rhythm 35, longevity 100
- inputs: {"age_days": 6040, "days_push": 89, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases, archived, no_license
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 2767, forks 262 (observed 2026-08-28T04:07:18.687065+00:00)

## What it is
Bleach is a Python library for sanitizing HTML from untrusted sources using an allowlist-based approach, escaping or stripping markup and attributes. It also safely linkifies text and relies on html5lib to handle malformed HTML as browsers do.

## Use cases
- sanitize user-submitted HTML comments to prevent XSS
- strip dangerous tags and attributes from untrusted text
- clean HTML fragments from rich text editors
- linkify URLs in plain text safely
- fix unbalanced or mis-nested HTML tags
- escape script tags in user input

## When to choose
- you need allowlist-based HTML sanitization in Python and can accept an unmaintained dependency
- you need browser-grade handling of malformed HTML fragments
- you need safe linkification with rel attribute control

## When to avoid
- starting a new project - the project is no longer maintained and will receive no security fixes
- you need guaranteed security patches for sanitization of untrusted input
- you want to let trusted administrators use rich HTML - Bleach is designed for untrusted sources

## Facets
- artifact type: library
- maturity: abandoned
- function: security, parser, serialization
- domain: web-development, security, developer-tools
- platform: python
- tags: html-sanitizer, html-sanitization, xss-prevention, linkify, allowlist, untrusted-input, no-longer-maintained

## Member repositories
- mozilla/bleach (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:07:18.687065+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T08:16:44.492078+00:00, confidence not recorded.
  - readme: https://github.com/mozilla/bleach (fetched 2026-08-28T04:07:18.687065+00:00, sha 56856d7b4bf5)
  - registry_pypi: https://pypi.org/pypi/bleach/json (fetched 2026-08-29T09:56:46.041769+00:00, sha 6921fd4cfd49)
- Data as of 2026-08-30T08:39:29.467469+00:00.
