rahul-rahul-sp opened a new pull request #7467: Change kv content-type to text/plain URL: https://github.com/apache/incubator-superset/pull/7467 ### CATEGORY Choose one - [X] Bug Fix - [ ] Enhancement (new features, refinement) - [ ] Refactor - [ ] Add tests - [ ] Build / Development Environment - [ ] Documentation ### SUMMARY <!--- Describe the change below, including rationale and design decisions --> Superset provides endpoints for storing and retrieving key-value pairs from database storage. For example, /explore/kv/store takes a data POST parameter for an arbitrary string to store and returns the corresponding key, which is a simple integer counter. To retrieve the saved data, users issue a GET request to /explore/kv/<key>. The application returns the associated value with the response Content-Type set to text/html, meaning it is possible for users to construct arbitrary HTML pages. The attacker can simply create another key-value pair with JavaScript source code in the value and include it from the constructed HTML page. Since the script source comes from the same origin as the HTML page, the CSP permits the browser to execute it ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF <!--- Skip this if not applicable --> ### TEST PLAN Tested that the value returned is text/plain ### ADDITIONAL INFORMATION <!--- Check any relevant boxes with "x" --> <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue --> - [ ] Has associated issue: - [ ] Changes UI - [ ] Requires DB Migration. - [ ] Confirm DB Migration upgrade and downgrade tested. - [ ] Introduces new feature or API - [ ] Removes existing feature or API ### REVIEWERS
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
