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

Escape id parameter for queues view #1687

Merged
merged 1 commit into from Jul 22, 2021

Conversation

brianvans
Copy link
Contributor

Fixes #1679

@@ -2,7 +2,7 @@

<% if current_queue = params[:id] %>

<h1>Pending jobs on <span class='hl'><%= current_queue %></span></h1>
<h1>Pending jobs on <span class='hl'><%= h current_queue %></span></h1>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

h is only available in rails and resque does not depend on rails. This should do the trick:

Suggested change
<h1>Pending jobs on <span class='hl'><%= h current_queue %></span></h1>
<h1>Pending jobs on <span class='hl'><%= ERB::Util.html_escape current_queue %></span></h1>

@brianvans does this look good to you?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

h is aliased as a helper over here:

https://github.com/brianvans/resque/blob/70f14b12d495ac0727cfe69fbfa2209fe2c42a31/lib/resque/server.rb#L28-L30

I noticed it was used in a few other views, so it made sense to use it here as well.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, nice! Didn't realize that.

@iloveitaly
Copy link
Contributor

@brianvans what do you think of the suggested change? If you commit/accept, I can work on getting this merged.

@iloveitaly
Copy link
Contributor

@chrisccerami Here's another one ready for merging!

@iloveitaly
Copy link
Contributor

@brianvans can you rebase on master so we can get the tests to pass?

@brianvans
Copy link
Contributor Author

@brianvans can you rebase on master so we can get the tests to pass?

Done!

Copy link
Contributor

@iloveitaly iloveitaly left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chrisccerami could you merge this one in?

@corincerami corincerami merged commit e8e2367 into resque:master Jul 22, 2021
@G-Rath
Copy link

G-Rath commented Nov 17, 2023

@brianvans @iloveitaly could we get a security advisory published for this?

@G-Rath
Copy link

G-Rath commented Nov 17, 2023

cc @corincerami just realised you're the one that did the merging

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

Successfully merging this pull request may close these issues.

Vulnerable to Reflected Cross Site Scripting through pathname
4 participants