Closed Bug 619637 (CVE-2010-4569) Opened 9 years ago Closed 9 years ago

[SECURITY] XSS in user autocomplete due to lack of encoding by YUI

Categories

(Bugzilla :: User Interface, defect, major)

3.7.1
defect
Not set
major

Tracking

()

RESOLVED FIXED
Bugzilla 4.0

People

(Reporter: reed, Assigned: reed)

References

(Blocks 1 open bug)

Details

(Whiteboard: [infrasec:xss][ws:critical])

Attachments

(1 file)

If a user's real name field happens to contain XSS, the user autocomplete UI will happily execute it, as it does no escaping of any potential valid HTML.

http://yuilibrary.com/forum/viewtopic.php?p=12923 talks about the problem somewhat.
Flags: blocking4.0?
Flags: blocking3.6.4?
WTF YUI! Man.

Autocomplete doesn't exist in 3.6.x, so it's not affected. But this should block 4.0 if you can get a patch to me ASAP.
Flags: blocking4.0?
Flags: blocking4.0+
Flags: blocking3.6.4?
Flags: blocking3.6.4-
Target Milestone: Bugzilla 3.6 → Bugzilla 4.0
Note that bmo is affected by this, even though it's running 3.6.x. I backported the user autocomplete stuff.
I filed http://yuilibrary.com/projects/yui2/ticket/2529228 upstream about this.
Summary: [SECURITY] XSS via real_name field in user autocomplete → [SECURITY] XSS in user autocomplete due to lack of encoding by YUI
Attached patch patch - v1Splinter Review
Attachment #498073 - Flags: review?(mkanat)
Isn't there some built-in HTML escaper in YUI?

What happens when YUI fixes this bug upstream, as they appear to intend to do?
(In reply to comment #5)
> Isn't there some built-in HTML escaper in YUI?

Not that I can see from poking around.

> What happens when YUI fixes this bug upstream, as they appear to intend to do?

We override the formatter anyway, so we'd still be vulnerable. I'll just modify our code to use their util function or whatever they offer.
CC'ing pyrzak as he knows YUI pretty well.
Blocks: 620540
Whiteboard: [infrasec:xss][ws:high] → [infrasec:xss][ws:critical]
CVE-2010-4569
Alias: CVE-2010-4569
Attachment #498073 - Flags: review?(guy.pyrzak)
Comment on attachment 498073 [details] [diff] [review]
patch - v1

This looks good and works for me until the proper upstream fix is implemented. r=dkl
Attachment #498073 - Flags: review+
Flags: approval?
Flags: approval4.0?
Does /regex/g work in IE?
(In reply to comment #10)
> Does /regex/g work in IE?

code-error.html.tmpl uses it, so I guess so, yes.
(In reply to comment #10)
> Does /regex/g work in IE?

Yes, since IE 4, I believe.
This patch does what reed wants it to do, which is escape incoming HTML, however, i'm not an XXS attack expert and I feel uncomfortable saying that this solution will stop all possible XXS attacks. But the attached patch (patch - v1), does escape incoming text that he lists in his code. Not sure if this is helpful or not. 

Basically the code looks good, my knowledge of the numerous ways to do a XXS attack are to limited to know if this patch is enough to stop the behavior in question.
Attachment #498073 - Flags: review?(guy.pyrzak)
Comment on attachment 498073 [details] [diff] [review]
patch - v1

This does look correct and it's the same as what YUI does, so at the least we will be just as secure as the DataTable text formatter.
Attachment #498073 - Flags: review?(mkanat) → review+
Version: 3.6.3 → 3.7.1
Flags: approval?
Flags: approval4.0?
Flags: approval4.0+
Flags: approval+
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/trunk/
modified js/field.js
Committed revision 7671.
Committing to: bzr+ssh://bzr.mozilla.org/bugzilla/4.0/
modified js/field.js
Committed revision 7528.
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Security advisory sent. Removing the security flag.
Group: bugzilla-security
Blocks: 835424
You need to log in before you can comment on or make changes to this bug.