Skip to content
KitploitKITPLOIT
FerramentasExploitsBlog
Log in
Enviar
FerramentasExploitsBlog
Enviar

Ferramentas de Hacking, PenTest e Cibersegurança para o seu Arsenal de Segurança!

Kitploit é um diretório de ferramentas de hacking, cibersegurança e pentesting. Descubra as últimas atualizações de projetos para encontrar vulnerabilidades, analisar sistemas, automatizar testes e fortalecer sua segurança.

FeedsContatoPrivacidade© 2026 Kitploit

Diretório de Ferramentas

Categorias

Ver todas as categorias
Loading categories
html-sanitizer — Fornece uma API orientada a objetos para sanitizar entradas HTML não confiáveis para inserção segura no DOM de um documento. | Kitploit
Ferramentas/GitHubGitHub/symfony/html-sanitizer
Ferramentas DefensivasExploração de Aplicações WebSegurança WebUtilitários e Frameworks
GitHubsymfony/html-sanitizer

html-sanitizer

Fornece uma API orientada a objetos para sanitizar entradas HTML não confiáveis para inserção segura no DOM de um documento.

Ver Repositório
2871428 de nov. de 2026Revisado pelo Kitploit
Compartilhar
Site

Componente HtmlSanitizer

O componente HtmlSanitizer fornece uma API orientada a objetos para sanitizar entradas HTML não confiáveis para inserção segura no DOM de um documento.

Uso

use Symfony\Component\HtmlSanitizer\HtmlSanitizerConfig;
use Symfony\Component\HtmlSanitizer\HtmlSanitizer;

// By default, an element not added to the allowed or blocked elements
// will be dropped, including its children
$config = (new HtmlSanitizerConfig())
    // Allow "safe" elements and attributes. All scripts will be removed
    // as well as other dangerous behaviors like CSS injection
    ->allowSafeElements()

    // Allow all static elements and attributes from the W3C Sanitizer API
    // standard. All scripts will be removed but the output may still contain
    // other dangerous behaviors like CSS injection (click-jacking), CSS
    // expressions, ...
    ->allowStaticElements()

    // Allow the "div" element and no attribute can be on it
    ->allowElement('div')

    // Allow the "a" element, and the "title" attribute to be on it
    ->allowElement('a', ['title'])

    // Allow the "span" element, and any attribute from the Sanitizer API is allowed
    // (see https://wicg.github.io/sanitizer-api/#default-configuration)
    ->allowElement('span', '*')

    // Block the "section" element: this element will be removed but
    // its children will be retained
    ->blockElement('section')

    // Drop the "div" element: this element will be removed, including its children
    ->dropElement('div')

    // Allow the attribute "title" on the "div" element
    ->allowAttribute('title', ['div'])

    // Allow the attribute "data-custom-attr" on all currently allowed elements
    ->allowAttribute('data-custom-attr', '*')

    // Drop the "data-custom-attr" attribute from the "div" element:
    // this attribute will be removed
    ->dropAttribute('data-custom-attr', ['div'])

    // Drop the "data-custom-attr" attribute from all elements:
    // this attribute will be removed
    ->dropAttribute('data-custom-attr', '*')

    // Forcefully set the value of all "rel" attributes on "a"
    // elements to "noopener noreferrer"
    ->forceAttribute('a', 'rel', 'noopener noreferrer')

    // Transform all HTTP schemes to HTTPS
    ->forceHttpsUrls()

    // Configure which schemes are allowed in links (others will be dropped)
    ->allowLinkSchemes(['https', 'http', 'mailto'])

    // Configure which hosts are allowed in links (by default all are allowed)
    ->allowLinkHosts(['symfony.com', 'example.com'])

    // Allow relative URL in links (by default they are dropped)
    ->allowRelativeLinks()

    // Configure which schemes are allowed in img/audio/video/iframe (others will be dropped)
    ->allowMediaSchemes(['https', 'http'])

    // Configure which hosts are allowed in img/audio/video/iframe (by default all are allowed)
    ->allowMediaHosts(['symfony.com', 'example.com'])

    // Allow relative URL in img/audio/video/iframe (by default they are dropped)
    ->allowRelativeMedias()

    // Configure a custom attribute sanitizer to apply custom sanitization logic
    // ($attributeSanitizer instance of AttributeSanitizerInterface)
    ->withAttributeSanitizer($attributeSanitizer)

    // Unregister a previously registered attribute sanitizer
    // ($attributeSanitizer instance of AttributeSanitizerInterface)
    ->withoutAttributeSanitizer($attributeSanitizer)
;

$sanitizer = new HtmlSanitizer($config);

// Sanitize a given string, using the configuration provided and in the
// "body" context (tags only allowed in <head> will be removed)
$sanitizer->sanitize($userInput);

// Sanitize the given string for a usage in a <head> tag
$sanitizer->sanitizeFor('head', $userInput);

// Sanitize the given string for a usage in another tag
$sanitizer->sanitizeFor('title', $userInput); // Will encode as HTML entities
$sanitizer->sanitizeFor('textarea', $userInput); // Will encode as HTML entities
$sanitizer->sanitizeFor('div', $userInput); // Will sanitize as body
$sanitizer->sanitizeFor('section', $userInput); // Will sanitize as body
// ...

Patrocinador

Este pacote está à procura de um apoiador.

Ajude o Symfony patrocinando o seu desenvolvimento!

Recursos

  • Contribuir
  • Reportar problemas e enviar Pull Requests no repositório principal do Symfony
Baixar ferramenta

Ferramentas relacionadas

  • wazuh

    Plataforma XDR e SIEM de código aberto para detecção de ameaças, análise de logs, monitoramento de integridade de arquivos, avaliação de vulnerabilidades e gerenciamento de conformidade em endpoints e cargas de trabalho na nuvem.

  • suricata

    Mecanismo open-source de IDS/IPS/NSM de rede para inspeção de tráfego em tempo real, detecção e prevenção de intrusões, análise de protocolos e caça a ameaças baseada em regras.

  • zeek

    Zeek é um poderoso framework de análise de rede que é muito diferente do IDS típico que você pode conhecer.

Mais Populares

Ver todos →

Descubra as ferramentas mais usadas pela nossa comunidade.

  • 1

    Callisto

    jetp1ane/callisto

    Ferramenta automatizada de análise de vulnerabilidades binárias que descompila executáveis via Ghidra, verifica código pseudo-C com Semgrep e valida descobertas usando GPT-3.5-Turbo para reduzir falsos positivos.

    2.2k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # Aplicativo de Execução em Um Toque GhostLock (CVE-2026-43499)

    844
  • 3

    DFRoot

    a2333c/dfroot

    Ferramenta de root para Android para Samsung Galaxy S25 Ultra (SM-S938B) que encadeia DirtyFrag CVE-2026-43284 e CVE-2026-43499 para obter root automaticamente no boot via KernelSU.

    447
  • 4

    ARTEX

    baarai/artex

    Plataforma autônoma de testes de penetração multiagente com LLM, com agentes planejador/executor, grafos de ativos e de exploração, registro de tráfego MITM e reteste de vulnerabilidades.

    383
  • 5

    OsintHunter

    letox4/osinthunter

    🎯 O kit definitivo de OSINT: grafo de investigação, pontuação de confiança, famílias de alias, mapa, linha do tempo e relatórios. 49 módulos, mais de 400 sites, sem necessidade de chaves de API.

    347
  • 6

    wifit3

    derv82/wifit3

    Wifite, mas apenas USB e multiplataforma.

    328

Explore todas as ferramentas

Navegue pela nossa coleção de ferramentas

Ver todas as ferramentas →