Bug 275351 - Cross-Site Scripting Security Vulnerability
Summary: Cross-Site Scripting Security Vulnerability
Status: RESOLVED FIXED
Alias: None
Product: RAP
Classification: RT
Component: RWT (show other bugs)
Version: 1.2   Edit
Hardware: All All
: P1 critical (vote)
Target Milestone: 1.2 RC1   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: needinfo
Depends on:
Blocks:
 
Reported: 2009-05-07 14:45 EDT by Austin Riddle CLA
Modified: 2009-05-11 09:05 EDT (History)
1 user (show)

See Also:


Attachments
patch to address XSS vulnerability (5.12 KB, patch)
2009-05-07 15:18 EDT, Cole Markham CLA
ruediger.herrmann: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Austin Riddle CLA 2009-05-07 14:45:29 EDT
Build ID: 1.2M6

There is a browser independent XSS vulnerability with the startup parameter in RAP.

Tested on Jetty and Tomcat deployments.

Steps To Reproduce:

1. Access a RAP application using this string:
(Obviously hostname, servletname, entrypoint need to be specified)

https://hostname/servletname?startup=entrypoint%3c%2fsCrIpT%3e%3csCrIpT%3ealert('Howdy')%3c%2fsCrIpT%3e

For example: http://rap.eclipse.org/rapdemo/rms?startup=rms%3C%2fsCrIpT%3E%3CsCrIpT%3Ealert('Howdy')%3C%2fsCrIpT%3E

Will allow the javascript to run.

This is usually flagged as a critical security hole.

We are working on a patch.
Comment 1 Cole Markham CLA 2009-05-07 15:18:43 EDT
Created attachment 134849 [details]
patch to address XSS vulnerability

Patch to encode the startup parameter when it could be presented to the user and executed by the browser.
Comment 2 Cole Markham CLA 2009-05-07 15:32:58 EDT
Another example URL that prompts the user for a password and would still allow that site to function.

http://rap.eclipse.org/rapdemo/rms?startup=rms");prompt("Howdy!%20Enter%20your%20password
Comment 3 Rüdiger Herrmann CLA 2009-05-08 06:59:48 EDT
Thank you very much for pointing this out. I committed the parts of the patch. Changes
are in CVS HEAD

I am unsure whether it is necessary to encode the exception messages in 
BrandingManager and EntryPointManager and therefore left these changes out for 
now. I would rahter assume that the error reporter (e.g. Tomcats or Jettys error
page mechanism) is in charge of sending a 'safe' error page. Moreover with the
changes to LifeCycleServiceHandlerConfigurer and BrowserSurvey, I could not
inject Javascript any more. Do you know of a way to break the app with only these
changes?
Comment 4 Austin Riddle CLA 2009-05-08 09:39:39 EDT
(In reply to comment #3)
Rüdiger,

After testing your proposed changes, I believe you are correct.  I think we were just erring on the side of caution by encoding the exceptions.  If we come up with anything else we will let you know.
Comment 5 Rüdiger Herrmann CLA 2009-05-08 09:43:30 EDT
(In reply to comment #4)
Austin,

thanks for verifying this. I will then close this bug. Please re-open or file a new one 
if you find further issues.