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

Change kv content-type to text/plain #7467

Merged
merged 2 commits into from
Jun 28, 2019
Merged

Change kv content-type to text/plain #7467

merged 2 commits into from
Jun 28, 2019

Conversation

rahul-rahul-sp
Copy link
Contributor

CATEGORY

Choose one

  • Bug Fix
  • Enhancement (new features, refinement)
  • Refactor
  • Add tests
  • Build / Development Environment
  • Documentation

SUMMARY

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/. 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

TEST PLAN

Tested that the value returned is text/plain

ADDITIONAL INFORMATION

  • 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

@rahul-rahul-sp
Copy link
Contributor Author

test this please

Copy link
Member

@mistercrunch mistercrunch left a comment

Choose a reason for hiding this comment

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

The linter wants you to use single quotes instead of double. Otherwise LGTM

@rahul-rahul-sp
Copy link
Contributor Author

seeing this error:
https://travis-ci.org/apache/incubator-superset/jobs/529428886

seems unrelated to my changes

@mistercrunch
Copy link
Member

Looks like a flaky test, I restarted to confirm.

@rahul-rahul-sp
Copy link
Contributor Author

can this be merged please?

@villebro villebro merged commit 4740086 into apache:master Jun 28, 2019
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.34.0 labels Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels size/XS 🚢 0.34.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants