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

不正なメンションを利用したXSSの修正 #3590

Closed
sapphi-red opened this issue Sep 15, 2022 · 3 comments
Closed

不正なメンションを利用したXSSの修正 #3590

sapphi-red opened this issue Sep 15, 2022 · 3 comments
Labels
bug Something isn't working priority:HIGH security Pull requests that address a security vulnerability

Comments

@sapphi-red
Copy link
Member

sapphi-red commented Sep 15, 2022

generateUserHref(id) {
return `javascript:openUserModal('${id}')`
},
generateUserGroupHref(id) {
return `javascript:openGroupModal('${id}')`
}

ここで'がエスケープされていない

そのため、javascript:openUserModal(' '); /* 任意のコード */ (' ')が実行可能

037f083 で修正済み

PoC

!{"type":"user","raw":"@sappi_red","id":"');alert('haha');console.log('"}

これを送信してメンションをクリックすると、アラートが表示される

@sapphi-red sapphi-red added bug Something isn't working priority:HIGH security Pull requests that address a security vulnerability labels Sep 15, 2022
@sapphi-red
Copy link
Member Author

このコミット起因なので、影響範囲は v3.12.0~v3.15.8
5b59bfa

sapphi-red added a commit to traPtitech/traq-markdown-it that referenced this issue Sep 15, 2022
@hijiki51
Copy link
Member

%22のようにエンコードすることでまだXSS可能だった

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority:HIGH security Pull requests that address a security vulnerability
Projects
None yet
Development

No branches or pull requests

2 participants