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

Incorrect rendering username in challenge solves page #1662

Open
determ1ne opened this issue Sep 20, 2020 · 1 comment
Open

Incorrect rendering username in challenge solves page #1662

determ1ne opened this issue Sep 20, 2020 · 1 comment

Comments

@determ1ne
Copy link

Environment: Ubuntu 18.04 LTS with Docker

  • CTFd Version/Commit: cfde6c9
  • Operating System: Linux (Ubuntu)
  • Web Browser and Version: Microsoft Edge 85.0.564.51

What happened?

Usernames containing "$" will be rendered incorrectly in challenge "* Solves" page(/challenges#CHALLENGE_NAME-CHALLENGE_ID).

For example, a user with username "$$$$" will be rendered as "$$".

What did you expect to happen?

"$$$$" -> "$$"

How to reproduce your issue

Install CTFd, create a user named "$$$$", create a challenge, submit the flag using the user.

Any associated stack traces or error logs

In https://github.com/CTFd/CTFd/blob/master/CTFd/themes/core/assets/js/utils.js#L47 , String.prototype.replace() will allow specifying a parameter by using a specific pattern with prefix '$'.

Related document: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace

The function should replace "$" with "$$" in arguments before real formatting happen.

@ColdHeat
Copy link
Member

ColdHeat commented Sep 20, 2020 via email

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