Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Support for HTML (see attached example rule)

オープン
#746 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

@Guflly がすでに取り組んでいます。

2026年8月1日 から。

  • #771 @Guflly による — オープン

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
静か
技術スタック
html, xml
領域
security, tooling

調査の方向性

まず既存の XML サポートを見つけ、そのルール処理を、提供されている DevSkim JSON ルールおよび HTML テストケースと比較します。target="_blank" と rel="noopener" の例に対する HTML カバレッジを追加し、安全でないリンクが検出され、安全なリンクが検出されないことを確認します。

索引モデルが issue の本文から書いたものです。

説明

bug

I would like to see support for HTML. Here is a working example DevSkim detection rule based of XML instead.

[
    {
        "name": "HTML_A_Tag_With_TargetBlank_Without_NoOpener",
        "id": "html_a_targetblank_noopener",
        "description": "Detects HTML <a> tags with target='_blank' that do not have the 'noopener' attribute in their rel, which can pose security risks.",
        "recommendation": "Add 'noopener' to the rel attribute of the HTML <a> tag.",
        "tags": ["security", "html", "a-tag", "noopener"],
        "severity": "BestPractice",
        "confidence": "high",
        "applies_to": ["xml"],
        "patterns": [
            {
                "pattern": "<a\\b(?=[^>]*target\\s*=\\s*[\"']_blank[\"'])(?!.*rel\\s*=\\s*[\"'][^\"']*noopener[^\"']*[\"'])[^>]*>",
                "type": "regex",
                "_comment": "Matches <a> tags with target='_blank' and without 'noopener' in rel attribute."
            }
        ]
    }
]

Test file

    <a href="https://example.com" target="_blank">Unsafe Link</a>
    <a href="https://example.com" rel="noreferrer" target="_blank">Unsafe Link</a>
    <a href="https://example.com" rel="" target="_blank">Unsafe Link</a>
    <a href="https://example.com">Safe Link</a>
    <a href="https://example.com" rel="noopener" target="_blank">Safe Link</a>
    <a href="https://example.com" rel="noopener noreferrer" target="_blank">Safe Link</a>

Perhaps this can be easily done with the already existing XML support.

主要言語
C#
スター
1k
フォーク
133
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

microsoft/DevSkim のほかの issue

microsoft/DevSkim の issue をすべて見る

似ている issue

C# の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。