We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
When performing a search, if the previewed article contains <script> tags, passing it to autocomplete-js results in the execution of the script.
Before adding the <${highlightTag}> markers, encode the article content using the encodeURIComponent function. Reference location: theme.js L237
<${highlightTag}>
encodeURIComponent
Follow the steps to reproduce and alert box pops up displaying "1". The location that causes code execution, in autocomplete-js
No response
Insert an article containing a <script> tag. For example:
# TEST ```html <script> alert("1"); </script> ```
Search for "TEST" within the article.
A browser alert box pops up displaying "1".
The text was updated successfully, but these errors were encountered:
f4e8bab
Lruihao
No branches or pull requests
Describe the bug 描述你遇到的错误
When performing a search, if the previewed article contains <script> tags, passing it to autocomplete-js results in the execution of the script.
Expected behavior 期待的行为
Before adding the
<${highlightTag}>
markers, encode the article content using theencodeURIComponent
function.Reference location: theme.js L237
Screenshots 屏幕截图
Follow the steps to reproduce and alert box pops up displaying "1".
![image](https://private-user-images.githubusercontent.com/23006921/305441940-7f8dca0a-66ec-4eba-a499-f8fd4e46ae4d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDc1MjgsIm5iZiI6MTczOTIwNzIyOCwicGF0aCI6Ii8yMzAwNjkyMS8zMDU0NDE5NDAtN2Y4ZGNhMGEtNjZlYy00ZWJhLWE0OTktZjhmZDRlNDZhZTRkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDE3MDcwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPThjYWIzMDFmMTc5ZGVlMGI4ZWRkMjk3MzNkY2M1MDMzMzczZGM2YzBhM2E5YmEwOWI0YTA0M2Q1ODJmODZhZGYmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.UmyqTWBGMImkp6eowVggMY195PsjkUAZO1LuhYP0Oeg)
![image](https://private-user-images.githubusercontent.com/23006921/305447616-7690686e-fbeb-4359-8838-e55063708980.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyMDc1MjgsIm5iZiI6MTczOTIwNzIyOCwicGF0aCI6Ii8yMzAwNjkyMS8zMDU0NDc2MTYtNzY5MDY4NmUtZmJlYi00MzU5LTg4MzgtZTU1MDYzNzA4OTgwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTAlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEwVDE3MDcwOFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTY3NWUzZjBlMDA5MWVhYTRlNjQwMTdlMTQ0MWIxOTRmMjBlNmJkYjQzYTZlYTU4ZjhmMjQ0ZjM4MWE0YWFiMGUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.N4B-9QQ1cERNa84NYNMgNxk1oH037nywB7LALwLePd4)
The location that causes code execution, in autocomplete-js
Build Environment 构建环境
Preview Environment 预览环境
No response
Additional Information 补充信息
Steps to Reproduce
Insert an article containing a <script> tag. For example:
Search for "TEST" within the article.
A browser alert box pops up displaying "1".
The text was updated successfully, but these errors were encountered: