-
Notifications
You must be signed in to change notification settings - Fork 14.6k
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
Use json for imports and exports, not pickle #4243
Use json for imports and exports, not pickle #4243
Conversation
85c6190
to
2f7e195
Compare
superset/views/core.py
Outdated
@@ -1919,7 +1945,7 @@ def dashboard(self, dashboard_id): | |||
else: | |||
qry = qry.filter_by(slug=dashboard_id) | |||
|
|||
dash = qry.one() | |||
dash = qry.first()#one() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Importing a new dashboard from an existing dashboard leaves the slug value the same and when .one()
has more than one result, it errors out.
Would it be better to avoid importing dashboards with the same slug or to add a random new slug or just return the first slug?
196915d
to
d85aead
Compare
d85aead
to
2a16808
Compare
acedfe1
to
1c8eee2
Compare
1c8eee2
to
48a79e1
Compare
@@ -240,6 +241,55 @@ def dttm_from_timtuple(d): | |||
d.tm_year, d.tm_mon, d.tm_mday, d.tm_hour, d.tm_min, d.tm_sec) | |||
|
|||
|
|||
def decode_dashboards(o): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think using jsonpickle with custom handlers for encoding/decoding would be more pythonic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree it would be more pythonic but as it turns out, jsonpickle is also susceptible to the RCE attack.
PING |
this looks good to me |
💯 |
* make superset imports and exports use json, not pickle * fix tests
This reverts commit 2c72a7a.
* make superset imports and exports use json, not pickle * fix tests
Note this is CVE-2018-8021 |
* make superset imports and exports use json, not pickle * fix tests
Importing and exporting dashboards with pickle files, which the user controls poses a security vulnerability. A well constructed pickle file can potentially spawn a shell.
The exploit is fleshed out here (https://blog.nelhage.com/2011/03/exploiting-pickle/)
This PR changes the format of the exported and imported files to json strings and eliminates this possibility.
@mistercrunch @john-bodley @michellethomas