Skip to content
KitploitKITPLOIT
ИнструментыЭксплойтыБлог
Log in
Отправить
ИнструментыЭксплойтыБлог
Отправить

Инструменты для хакинга, пентеста и кибербезопасности — ваш арсенал защиты!

Kitploit — это каталог инструментов для хакинга, кибербезопасности и пентестинга. Находите последние обновления проектов для поиска уязвимостей, анализа систем, автоматизации тестирования и усиления вашей безопасности.

ЛентыКонтактыКонфиденциальность© 2026 Kitploit

Каталог инструментов

Категории

Все категории
Loading categories
html-sanitizer — Предоставляет объектно-ориентированный API для очистки недоверенного HTML-ввода с целью безопасной вставки в DOM документа. | Kitploit
Инструменты/GitHubGitHub/symfony/html-sanitizer
Оборонительные ИнструментыЭксплуатация веб-приложенийВеб-безопасностьУтилиты и фреймворки
GitHubsymfony/html-sanitizer

html-sanitizer

Предоставляет объектно-ориентированный API для очистки недоверенного HTML-ввода с целью безопасной вставки в DOM документа.

Репозиторий
2871428 нояб. 2026 г.Проверено Kitploit
Поделиться
Сайт

Компонент HtmlSanitizer

Компонент HtmlSanitizer предоставляет объектно-ориентированный API для очистки недоверенного HTML-ввода для безопасной вставки в DOM документа.

Использование

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

Спонсор

Этот пакет ищет kpref-5c16eb6c043a26989eb7e4d77f9cdca37412103ec42e17532ccfdc428286dd0c.

Помогите Symfony, kpref-91546c6d03ad1385964b0e929b3fbadb102e788299a6f2025c2f8172a2567ed3 его разработку!

Ресурсы

  • Участие в разработке
  • Сообщить о проблемах и отправить Pull Requests в основной репозиторий Symfony
Скачать инструмент

Похожие инструменты

  • wazuh

    Открытая платформа XDR и SIEM для обнаружения угроз, анализа журналов, мониторинга целостности файлов, оценки уязвимостей и управления соответствием требованиям на конечных точках и в облачных нагрузках.

  • suricata

    Движок сетевой IDS/IPS/NSM с открытым исходным кодом для инспекции трафика в реальном времени, обнаружения и предотвращения вторжений, анализа протоколов и охоты за угрозами на основе правил.

  • zeek

    Zeek — это мощный фреймворк для анализа сети, который сильно отличается от типичных IDS, которые вы, возможно, знаете.

Популярное

Смотреть все →

Откройте для себя самые используемые инструменты нашего сообщества.

  • 1

    Callisto

    jetp1ane/callisto

    Автоматизированный инструмент анализа уязвимостей бинарных файлов, который декомпилирует исполняемые файлы с помощью Ghidra, сканирует псевдо-C код с помощью Semgrep и проверяет находки с использованием GPT-3.5-Turbo для уменьшения ложных срабатываний.

    2.2k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    # Приложение GhostLock с запуском в один клик (CVE-2026-43499)

    844
  • 3

    DFRoot

    a2333c/dfroot

    Инструмент для получения root-прав на Android для Samsung Galaxy S25 Ultra (SM-S938B), который объединяет DirtyFrag CVE-2026-43284 и CVE-2026-43499 для автоматического получения root-прав при загрузке через KernelSU.

    447
  • 4

    ARTEX

    baarai/artex

    Платформа автономного тестирования на проникновение на основе мультиагентной LLM с агентами-планировщиками и агентами-исполнителями, графами активов и исследования, записью MITM-трафика и повторной проверкой уязвимостей.

    383
  • 5

    OsintHunter

    letox4/osinthunter

    🎯 Полный набор инструментов OSINT: граф расследования, оценка достоверности, семейства псевдонимов, карта, временная шкала и отчёты. 49 модулей, более 400 сайтов, API-ключи не требуются.

    347
  • 6

    wifit3

    derv82/wifit3

    Wifite, но только через USB и кроссплатформенный.

    328

Изучить все инструменты

Просмотрите нашу коллекцию инструментов

Смотреть все инструменты →