Skip to content
KitploitKITPLOIT
HerramientasExploitsBlog
Log in
Enviar
HerramientasExploitsBlog
Enviar

¡Herramientas de Hacking, PenTest y Ciberseguridad para tu Arsenal de Seguridad!

Kitploit es un directorio de herramientas de hacking, ciberseguridad y pentesting. Descubre las últimas actualizaciones de proyectos para encontrar vulnerabilidades, analizar sistemas, automatizar pruebas y fortalecer tu seguridad.

FeedsContactoPrivacidad© 2026 Kitploit

Directorio de Herramientas

Categorías

Ver todas las categorías
Loading categories
ammonia — Whitelist-based HTML sanitization library in Rust that parses and serializes fragments per the HTML5 spec to prevent XSS, layout breaking, and clickjacking from untrusted user HTML. | Kitploit
Herramientas/GitHubGitHub/rust-ammonia/ammonia
Defensive ToolsCode AnalysisWeb Application ExploitationWeb SecurityUtilities & Frameworks
GitHubrust-ammonia/ammonia

ammonia

Whitelist-based HTML sanitization library in Rust that parses and serializes fragments per the HTML5 spec to prevent XSS, layout breaking, and clickjacking from untrusted user HTML.

Ver Repositorio
6915829 nov 2026Revisado por Kitploit
Compartir
Contenido no disponible en el idioma solicitado. Mostrando versión en inglés.

HTML Sanitization

crates.io Requires rustc 1.85.0

Ammonia is a whitelist-based HTML sanitization library. It is designed to prevent cross-site scripting, layout breaking, and clickjacking caused by untrusted user-provided HTML being mixed into a larger web page.

Ammonia uses html5ever to parse and serialize document fragments the same way browsers do, so it is extremely resilient to syntactic obfuscation.

Ammonia parses its input exactly according to the HTML5 specification; it will not linkify bare URLs, insert line or paragraph breaks, or convert (C) into ©. If you want that, use a markup processor before running the sanitizer, like pulldown-cmark.

Installation

To use ammonia, add it to your project's Cargo.toml file:

[dependencies]
ammonia = "4.2"

Changes

Please see the CHANGELOG for a release history.

Example

Using pulldown-cmark together with Ammonia for a friendly user-facing comment site.

use ammonia::clean;
use pulldown_cmark::{Parser, Options, html::push_html};

let text = "[a link](http://www.notriddle.com/)";

let mut options = Options::empty();
options.insert(Options::ENABLE_TABLES);

let mut md_parse = Parser::new_ext(text, options);
let mut unsafe_html = String::new();
push_html(&mut unsafe_html, md_parse);

let safe_html = clean(&*unsafe_html);
assert_eq!(safe_html, "<a href=\"http://www.notriddle.com/\">a link</a>");

Performance

Ammonia builds a DOM, traverses it (replacing unwanted nodes along the way), and serializes it again. It could be faster for what it does, and if you don't want to allow any HTML it is possible to be even faster than that.

However, it takes about fifteen times longer to sanitize an HTML string using bleach-2.0.0 with html5lib-0.999999999 than it does using Ammonia 1.0.

$ cd benchmarks
$ cargo run --release
    Running `target/release/ammonia_bench`
87539 nanoseconds to clean up the intro to the Ammonia docs.
$ python bleach_bench.py
(1498800.015449524, 'nanoseconds to clean up the intro to the Ammonia docs.')

License

Licensed under either of these:

  • Apache License, Version 2.0, (LICENSE-APACHE or https://www.apache.org/licenses/LICENSE-2.0)
  • MIT license (LICENSE-MIT or https://opensource.org/license/mit)

Thanks

Thanks to the other sanitizer libraries, particularly Bleach for Python and sanitize-html for Node.js, which we blatantly copied most of our API from.

Thanks to ChALkeR, whose improper markup sanitization document helped us find high-level semantic holes in Ammonia, to ssokolow, whose review and experience were also very helpful, to securityMB, for finding a very obscure namespace-related injection bug, [email protected], for finding another obscure namespace-related injection bug, and xfix for finding a DoS bug in a recursive destructor.

And finally, thanks to the contributors.

Descargar herramienta

Herramientas relacionadas

  • wazuh

    Plataforma XDR y SIEM de código abierto para detección de amenazas, análisis de registros, monitoreo de integridad de archivos, evaluación de vulnerabilidades y gestión de cumplimiento normativo en endpoints y cargas de trabajo en la nube.

  • suricata

    Motor de red IDS/IPS/NSM de código abierto para inspección de tráfico en tiempo real, detección y prevención de intrusiones, análisis de protocolos y búsqueda de amenazas basada en reglas.

  • zeek

    Zeek es un potente marco de análisis de redes que es muy diferente del típico IDS que puedas conocer.

Más Populares

Ver todos →

Descubre las herramientas más usadas por nuestra comunidad.

  • 1

    Callisto

    jetp1ane/callisto

    Herramienta automatizada de análisis de vulnerabilidades binarias que descompila ejecutables mediante Ghidra, escanea código pseudo-C con Semgrep y valida los hallazgos usando GPT-3.5-Turbo para reducir falsos positivos.

    2.2k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # Aplicación de Ejecución con un Solo Toque GhostLock (CVE-2026-43499)

    844
  • 3

    DFRoot

    a2333c/dfroot

    Herramienta de root para Android para Samsung Galaxy S25 Ultra (SM-S938B) que encadena DirtyFrag CVE-2026-43284 y CVE-2026-43499 para obtener root automáticamente al arrancar mediante KernelSU.

    447
  • 4

    ARTEX

    baarai/artex

    Plataforma de pruebas de penetración autónoma multiagente basada en LLM con agentes planificadores/trabajadores, grafos de activos y de exploración, registro de tráfico MITM y reevaluación de vulnerabilidades.

    383
  • 5

    OsintHunter

    letox4/osinthunter

    🎯 El kit de herramientas OSINT definitivo: grafo de investigación, puntuación de confianza, familias de alias, mapa, línea de tiempo e informes. 49 módulos, más de 400 sitios, sin necesidad de claves API.

    347
  • 6

    wifit3

    derv82/wifit3

    Wifite pero solo USB y multiplataforma.

    328

Explora todas las herramientas

Explora nuestra colección de herramientas

Ver todas las herramientas →