Skip to content

Cross Site Scripting(XSS)vulnerability in code-server #4355

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

Closed
Jyhtpy opened this issue Oct 14, 2021 · 7 comments · Fixed by #4430
Closed

Cross Site Scripting(XSS)vulnerability in code-server #4355

Jyhtpy opened this issue Oct 14, 2021 · 7 comments · Fixed by #4430
Labels
security Security related

Comments

@Jyhtpy
Copy link

Jyhtpy commented Oct 14, 2021

OS/Web Information

  • Web Browser: firefox
  • Local OS: Debian
  • Remote OS:Debian
  • Remote Architecture:
  • code-server --version: v3.12.0

Steps to Reproduce

1.Open your browser and insert payload /static/test%3Cmy_tag_efb4535077ba29aaca28167c491b4249/%3E%3Cimg%20src=x%3E%3Cscript%3Ealert(1)%3C/script%3E

2.example: http://127.0.0.1:8080/static/test%3Cmy_tag_efb4535077ba29aaca28167c491b4249/%3E%3Cimg%20src=x%3E%3Cscript%3Ealert(1)%3C/script%3E

Screenshot

image

Notes

This issue can be reproduced in VS Code: Yes

@code-asher code-asher added the security Security related label Oct 18, 2021
@code-asher code-asher added this to the Backlog milestone Oct 27, 2021
@jsjoeio
Copy link
Contributor

jsjoeio commented Oct 28, 2021

@code-asher is this expected since the person would have to have access to the vm/machine running code-server?

@mauri-sfdc
Copy link

@jsjoeio someone can send you a forged link that makes you execute arbitrary code in your code-server instance. See https://owasp.org/www-community/attacks/xss/

@code-asher
Copy link
Member

code-asher commented Oct 29, 2021 via email

@mauri-sfdc
Copy link

@code-asher in my experience it's better to use a templating language that escapes everything by default, habits are hard to change ;)

@code-asher
Copy link
Member

code-asher commented Oct 29, 2021 via email

@mauri-sfdc
Copy link

@code-asher I can take a crack at the fix

@jsjoeio
Copy link
Contributor

jsjoeio commented Oct 29, 2021

@mauri-sfdc that would be awesome! Thank you for reporting this and providing extra links (for me!). Let us know how we can help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
security Security related
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants