Skip to content
KitploitKITPLOIT
ツールエクスプロイトブログ
Log in
提出
ツールエクスプロイトブログ
提出

ハッキング、侵入テスト、サイバーセキュリティツールをあなたのセキュリティアーセナルに!

Kitploitはハッキング、サイバーセキュリティ、ペネトレーションテストのツールディレクトリです。最新のプロジェクトアップデートを見つけて、脆弱性の発見、システム分析、テストの自動化、セキュリティの強化を行いましょう。

フィードお問い合わせプライバシー© 2026 Kitploit

ツールディレクトリ

カテゴリ

すべてのカテゴリを見る
Loading categories
html-sanitizer — 信頼できないHTML入力をサニタイズし、ドキュメントのDOMに安全に挿入するためのオブジェクト指向APIを提供します。 | Kitploit
ツール/GitHubGitHub/symfony/html-sanitizer
防御ツールウェブアプリケーション悪用ウェブセキュリティユーティリティとフレームワーク
GitHubsymfony/html-sanitizer

html-sanitizer

信頼できないHTML入力をサニタイズし、ドキュメントのDOMに安全に挿入するためのオブジェクト指向APIを提供します。

リポジトリを見る
287142026年11月28日Kitploit レビュー済み
共有
ウェブサイト

HtmlSanitizer コンポーネント

HtmlSanitizer コンポーネントは、信頼できない HTML 入力をサニタイズし、ドキュメントの DOM に安全に挿入できるようにするためのオブジェクト指向 API を提供します。

使用方法

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

スポンサー

このパッケージは支援者を募集しています。

Symfonyの開発をスポンサーになって支援しましょう!

リソース

  • コントリビュート
  • 問題を報告し、 プルリクエストを送信 Symfonyメインリポジトリにて
ツールをダウンロード

関連ツール

  • wazuh

    オープンソースのXDRおよびSIEMプラットフォーム。脅威検出、ログ分析、ファイル整合性監視、脆弱性評価、コンプライアンス管理をエンドポイントおよびクラウドワークロード全体で実現します。

  • suricata

    リアルタイムのトラフィック検査、侵入検知・防御、プロトコル解析、およびルールベースの脅威ハンティングのためのオープンソースのネットワーク IDS/IPS/NSM エンジン。

  • zeek

    Zeekは、あなたが知っている典型的なIDSとは大きく異なる、強力なネットワーク分析フレームワークです。

人気

すべて見る →

コミュニティで最も使われているツールを見つけましょう。

  • 1

    Callisto

    jetp1ane/callisto

    Ghidraを介して実行可能ファイルを逆コンパイルし、Semgrepで擬似Cコードをスキャンし、GPT-3.5-Turboを使用して検出結果を検証することで誤検知を低減する、自動化されたバイナリ脆弱性解析ツール。

    2.2k
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock ワンタップ実行アプリ(CVE-2026-43499)

    844
  • 3

    DFRoot

    a2333c/dfroot

    Samsung Galaxy S25 Ultra (SM-S938B) 向けの Android root ツール。DirtyFrag CVE-2026-43284 と CVE-2026-43499 を連鎖させ、KernelSU 経由で起動時に自動的に root を取得します。

    447
  • 4

    ARTEX

    baarai/artex

    プランナー/ワーカーエージェント、資産グラフと探索グラフ、MITMトラフィック記録、脆弱性の再テストを備えたLLMマルチエージェント自律ペネトレーションテストプラットフォーム。

    383
  • 5

    OsintHunter

    letox4/osinthunter

    🎯 究極のOSINTツールキット:調査グラフ、信頼度スコアリング、エイリアスファミリー、マップ、タイムライン、レポート。49個のモジュール、400以上のサイト、APIキー不要。

    347
  • 6

    wifit3

    derv82/wifit3

    Wifite だが、USB のみ対応でクロスプラットフォーム

    328

すべてのツールを探索

ツールコレクションを閲覧

すべてのツールを見る →