Skip to content

#article プラグインで任意のJavaScriptコードが実行される危険性 #22

Description

@ishimaru130

#articleプラグインで掲示板を設置した場合、メッセージ内容に#htmlプラグインを大文字で
記述した場合に、lib/func.phpのwikiescapeでは小文字の#htmlで始まる行しか
文字パターンにマッチせずに、JavaScriptを記述した場合に実行されてしまう危険性がある。

lib/func.php の function wikiescape 内の
$ret .= preg_replace('/^#html/', "# html", $line) ."\n";

$ret .= preg_replace('/^(#)(html|beforescript|style|lastscript)/i', "$1 $2", $line) ."\n";
とすると回避出来るようです。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions