Skip to content
This repository has been archived by the owner on May 5, 2020. It is now read-only.

CVE-2013-6415: Escape the unit value provided to number_to_currency #31

Merged
merged 2 commits into from
Dec 3, 2013

Conversation

zerowidth
Copy link
Member

Fixes CVE-2013-6415.

Previously the values were trusted blindly allowing for potential XSS attacks.

This is different from the original upstream patch for 3.x: return values from other number helper methods are not marked as html_safe?, so the html escaping always applies. This requires applications to explicitly call .html_safe on unit strings and number separators when calling number_to_currency.

Fixes CVE-2013-6415.

Previously the values were trusted blindly allowing for potential XSS attacks.

This is different from the original upstream patch for 3.x in that return values
from other number helper methods are not marked as html_safe, so the html
escaping always applies. This requires applications to explicitly set .html_safe
on unit strings and number separators when calling number_to_currency.
@zerowidth
Copy link
Member Author

@btoews
Copy link

btoews commented Dec 3, 2013

Looks good to me.

@ptoomey3
Copy link
Member

ptoomey3 commented Dec 3, 2013

👍

@haileys
Copy link

haileys commented Dec 3, 2013

:shipit:

zerowidth added a commit that referenced this pull request Dec 3, 2013
CVE-2013-6415: Escape the unit value provided to number_to_currency
@zerowidth zerowidth merged commit dfa2f46 into 2-3-github Dec 3, 2013
@zerowidth zerowidth deleted the currency-security-fix branch December 3, 2013 22:41
haileys pushed a commit that referenced this pull request Dec 18, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants