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

XSS on TaxonomyController #76

Open
S-DICKSON opened this issue May 26, 2020 · 7 comments
Open

XSS on TaxonomyController #76

S-DICKSON opened this issue May 26, 2020 · 7 comments
Assignees

Comments

@S-DICKSON
Copy link
Contributor

  1. Create a new taxonomy
  2. Set name to <script>alert("YOu juST beEn hackED ( ͡° ͜ʖ ͡°) ")</script>
  3. Submit
  4. See alert on the index page

This issue also occurs in TaxonController@Create.

@fulopattila122
Copy link
Member

Thx for the report!

  • does it only apply only to name?
  • only taxon and taxonomy?

@fulopattila122 fulopattila122 self-assigned this May 26, 2020
@S-DICKSON
Copy link
Contributor Author

S-DICKSON commented May 26, 2020

Hi the issues seems to be when Update or Store has been made and the request is redirected to the index page. {{ $variable }} is not escaping the characters and seems to be working after refresh this is only an assumption though I've not looked into how Laravel escapes characters.

I've justed tested <script>alert("YOu juST beEn hackED ( ͡° ͜ʖ ͡°) ")</script> on these controller so far

  • TaxonomyController
  • TaxonController
  • ProductController
  • PropertyController

I'll let you know if I find anymore.

@fulopattila122
Copy link
Member

Fair enough, I'll check them. Thx!

@S-DICKSON
Copy link
Contributor Author

  • ChannelController

@S-DICKSON
Copy link
Contributor Author

  • PropertyValueController@create

@fulopattila122
Copy link
Member

Checked it myself, and it only affects the flash message after creation or update.
Basically one can only hack himself :) but I'll give it a fix

@fulopattila122
Copy link
Member

The issue comes from the laracasts/flash package, see https://github.com/laracasts/flash/blob/3.1/src/views/message.blade.php#L22

The default, intended behavior is to be able to pass HTML to the flash messages from the code.
This can be easily modified:

  1. php artisan vendor:publish --provider="Laracasts\Flash\FlashServiceProvider"
  2. Edit resources/views/vendor/flash/message.blade.php
  3. Change line 22 from {!! $message['message'] !!} to {{ $message['message'] }}

For Vanilo v1 I'll leave it as it is so that it doesn't break existing apps that rely on this behavior. The framework itself doesn't pass any HTML, so for v2 I'll change this behavior so that flash messages are escaped by default.

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

No branches or pull requests

2 participants