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

security: XSS vulnerability (CVE-2023-23277) #57

Open
go-compile opened this issue Jan 8, 2023 · 2 comments
Open

security: XSS vulnerability (CVE-2023-23277) #57

go-compile opened this issue Jan 8, 2023 · 2 comments

Comments

@go-compile
Copy link

XSS/Cross Site Scripting Vulnerability

Vulnerability: XSS
Severity: VERY HIGH
Image: pawelmalak/snippet-box:arm
Digest: sha256:ba9245cc339d159588c76b33f0ae708f5c1af68a27f876561b8b84ed5b8ee288

Why this is a problem: Snippet-box doesn't have authentication, allowing anyone to perform this attack. Furthermore, if Snippet-box is running on a domain which is used by other services, e.g. Nextcloud, then an attacker could potentially be able to perform a lateral move via extracting local storage; obtaining authentication tokens. Alternatively, one could perform CSRF, even if "same site cookies" are enabled, depending on the service, account take over may be possible due to XSS on the same domain.

Proof of Concept

  1. Create new snippet.
  2. Set the snippet content to:
<h1>HTML is being rendered</h1>
<p style="color: red">WARNING XSS</p>
<script>alert("XSS")</script>
  1. Copy "raw url"
  2. Navigate within a browser

Result

image

Cause

The cause to this vulnerability due to the raw snippet route setting content-type to text/html.

Resolution

Follow both steps.

  1. Set content-type to text/plain.
  2. Set header X-Content-Type-Options: nosniff.

Responsible disclosure statement: I was unable to find emergency contact information for reporting security concerns in private, as a result this issue has been created.

@schklom
Copy link

schklom commented Feb 4, 2023

This sounds like a job for a reverse-proxy.

@go-compile
Copy link
Author

For the time being it may be an appropriate temporary patch, but certainly not a permanent one.

@go-compile go-compile changed the title security: XSS vulnerability security: XSS vulnerability (CVE-2023-23277) Feb 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants