Skip to content
KitploitKITPLOIT
StrumentiExploitsBlog
Log in
Invia
StrumentiExploitsBlog
Invia

Strumenti di Hacking, PenTest e Cybersecurity per il tuo Arsenale di Sicurezza!

Kitploit è una directory di strumenti di hacking, cybersecurity e pentesting. Scopri gli ultimi aggiornamenti dei progetti per trovare vulnerabilità, analizzare sistemi, automatizzare i test e rafforzare la tua sicurezza.

FeedContattoPrivacy© 2026 Kitploit

Directory degli strumenti

Categorie

Vedi tutte le categorie
Loading categories
html-sanitizer — Fornisce un'API orientata agli oggetti per sanificare input HTML non attendibile ai fini di un inserimento sicuro nel DOM di un documento. | Kitploit
Strumenti/GitHubGitHub/symfony/html-sanitizer
Strumenti DifensiviSfruttamento di Applicazioni WebSicurezza WebUtilità e Framework
GitHubsymfony/html-sanitizer

html-sanitizer

Fornisce un'API orientata agli oggetti per sanificare input HTML non attendibile ai fini di un inserimento sicuro nel DOM di un documento.

Vedi Repository
2871428 nov 2026Revisionato da Kitploit
Condividi
Sito web

Componente HtmlSanitizer

Il componente HtmlSanitizer fornisce un'API orientata agli oggetti per sanificare input HTML non attendibile per un inserimento sicuro nel DOM di un documento.

Utilizzo

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
// ...

Sponsor

Questo pacchetto è alla ricerca di un sostenitore.

Aiuta Symfony sponsorizzando il suo sviluppo!

Risorse

  • Contribuire
  • Segnalare problemi e inviare Pull Requests nel repository principale di Symfony
Scarica lo strumento

Strumenti correlati

  • wazuh

    Piattaforma XDR e SIEM open-source per rilevamento delle minacce, analisi dei log, monitoraggio dell'integrità dei file, valutazione delle vulnerabilità e gestione della conformità su endpoint e carichi di lavoro cloud.

  • suricata

    Motore open-source IDS/IPS/NSM di rete per l'ispezione del traffico in tempo reale, rilevamento e prevenzione delle intrusioni, analisi dei protocolli e caccia alle minacce basata su regole.

  • zeek

    Zeek è un potente framework di analisi di rete molto diverso dal tipico IDS che potresti conoscere.

Più Popolari

Vedi tutti →

Scopri gli strumenti più utilizzati dalla nostra community.

  • 1

    Callisto

    jetp1ane/callisto

    Strumento automatizzato di analisi delle vulnerabilità binarie che decompila eseguibili tramite Ghidra, esegue la scansione del pseudo-codice C con Semgrep e convalida i risultati utilizzando GPT-3.5-Turbo per ridurre i falsi positivi.

    2.2k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # App di esecuzione con un tocco GhostLock (CVE-2026-43499)

    844
  • 3

    DFRoot

    a2333c/dfroot

    Strumento di root per Android per Samsung Galaxy S25 Ultra (SM-S938B) che concatena DirtyFrag CVE-2026-43284 e CVE-2026-43499 per ottenere i privilegi di root automaticamente all'avvio tramite KernelSU.

    447
  • 4

    ARTEX

    baarai/artex

    Piattaforma di penetration testing autonoma multi-agente basata su LLM con agenti planner/worker, grafi di asset e di esplorazione, registrazione del traffico MITM e retesting delle vulnerabilità.

    383
  • 5

    OsintHunter

    letox4/osinthunter

    🎯 Il toolkit OSINT definitivo: grafo di indagine, punteggio di affidabilità, famiglie di alias, mappa, timeline e report. 49 moduli, oltre 400 siti, nessuna chiave API richiesta.

    347
  • 6

    wifit3

    derv82/wifit3

    Wifite ma solo USB e multipiattaforma.

    328

Esplora tutti gli strumenti

Sfoglia la nostra collezione di strumenti

Vedi tutti gli strumenti →