Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

テンプレート名称が投稿画面でエスケープされていない #845

Closed
nyoronjp opened this issue Sep 9, 2017 · 4 comments
Closed

Comments

@nyoronjp
Copy link
Contributor

nyoronjp commented Sep 9, 2017

システム設定>テンプレート>追加

テンプレート名称にHTMLタグ記述し保存。
001

投稿画面の種類でエスケープされずHTMLが解釈されている。
002

scriptタグも使えました。

<script>alert(1);</script>

管理者しかテンプレート追加ができないので仕様だったらすいません。

@koda-masaru
Copy link
Contributor

管理者が登録する部分はご指摘の通り、HTMLのエスケープをわざとしていない所があります。
(例えばアナリティクスの設定とか。明示的にスクリプトを登録出来るようにしています。)
この部分も、別にいらないかなと思ってそのままにしたのですが、そこまで意味があるわけでもありません。
次のバージョンでは、エスケープするようにしようと思います。

@nyoronjp
Copy link
Contributor Author

管理画面のXSS対策ってどこまでやるべきかの判断って難しいですね。イントラ内で使うものだと特に。
アナリティクスの設定だと全体に反映できるJavaScriptやCSS書けて便利ですし。

投稿で種類をbookmarkにし、URLにjavascript:alert(1)と入力すればクリックすることでアラート出せます。
image
これも想定した使い方なんでしょうか?

@koda-masaru
Copy link
Contributor

む、、、
これは、エスケープ漏れですね(ユーザが登録する部分はエスケープ対象)
次のバージョンまでに修正します。

koda-masaru added a commit that referenced this issue Sep 13, 2017
@nyoronjp
Copy link
Contributor Author

nyoronjp commented Oct 5, 2017

Knowledge v1.11.0 pre2

I confirmed.
Thanks.

@nyoronjp nyoronjp closed this as completed Oct 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants