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

[CVE-2023-27075] Security issues for Stored XSS #142

Closed
7a6163 opened this issue Feb 20, 2023 · 9 comments
Closed

[CVE-2023-27075] Security issues for Stored XSS #142

7a6163 opened this issue Feb 20, 2023 · 9 comments

Comments

@7a6163
Copy link
Contributor

7a6163 commented Feb 20, 2023

Hello, I found an XSS issue in the project.

Although there is nothing about authentication cookies, an attacker can redirect to a malicious site or insert malicious code.

Payload:

</script><script>alert('xss')</script>

image

Root cause:

self.content.replace('`', "\\`").replace('$', "\\$")

@7a6163 7a6163 changed the title Security issues for XSS Security issues for Stored XSS Feb 20, 2023
@7a6163 7a6163 changed the title Security issues for Stored XSS [CVE request] Security issues for Stored XSS Mar 1, 2023
@schrottkatze
Copy link

I've discovered that a while ago too and contacted the maintainer about it on the 2023-02-16., but they didn't respond yet.

If anyone is interested in a fork of microbin by... well, me (which fixes that and adds some other features that were requested here), here is the link to the repo: https://gitlab.com/obsidianical/microbin

@matze
Copy link

matze commented Mar 4, 2023

There are more severe things:

  • The service is not handling invalid UTF-8 data well and panics. This keeps the lock on the "database" poisoned rendering the service inaccessible.
  • The service keeps a lock while operating on its database, making async kind of pointless.
  • The service serializes and writes the entire database file to disk each time a pasta is fetched. This will not scale well in the long run.

Disclaimer: I write a similar service

@schrottkatze
Copy link

Microbins json database is a joke. I'm aware of that. It's kinda a high priority TODO for my fork at the moment.

How do I reproduce the UTF-8 data thing? I'm gonna look into fixing that ASAP if I can diagnose it

@matze
Copy link

matze commented Mar 4, 2023

How do I reproduce the UTF-8 data thing?

Paste invalid UTF-8 and you are good.

@schrottkatze
Copy link

I've tried crashing a local dev instance, and I haven't been able to, even after pasting a raw binary program, random bytes, and a stress tester file for invalid UTF-8. I don't think that'll cause many problems, since triggering this issue at all was quite impossible to me so far. If you can provide a sample of a string that does crash it, please do.

@matze
Copy link

matze commented Mar 4, 2023

It does not crash the entire server because actix installs a panic handler but it renders the upload and a few other endpoints useless. Try

wget https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt
curl -F "expiration=10min" -F content=@UTF-8-test.txt -X POST http://0.0.0.0:8080/upload

From now on, every time you try to paste something either via the REST endpoint or the UI, it will fail with

thread 'actix-rt|system:0|arbiter:0' panicked at 'called `Result::unwrap()` on an `Err` value: PoisonError { .. }', src/endpoints/create.rs:40:41

Edit: also the List and Info endpoints do not work anymore.

@schrottkatze
Copy link

schrottkatze commented Mar 4, 2023

While there seems to be an error, pasting still seems to work on my fork. It seems that I fixed the problem preventing pasting (by accident)

The fix seems to have been that I switched to an async aware mutex for another unrelated reason, which seems to unlock after a thread crashes.

@7a6163 7a6163 changed the title [CVE request] Security issues for Stored XSS [CVE-2023-27075] Security issues for Stored XSS Mar 17, 2023
@ldpr
Copy link

ldpr commented Mar 19, 2023

@szabodanika, apologies for tagging you. With this CVE in the wild for a month, should we consider this project unmaintained? Apologies for being blunt, I love the tool and just wanted to know the status :)

@szabodanika szabodanika added this to the Targeting v1.3.0 milestone Mar 26, 2023
@szabodanika
Copy link
Owner

Thanks a lot @7a6163 for #143! I apologise, I had to put aside personal projects as I was very busy with work and studies. I am back on working on v1.3.0 release now, cleaning up backlog in priority order. I am an active user of this software, therefore it will never be abandoned.

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

5 participants