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

Use JSONVariable instead of Pickle (GL01-00??) #295

Closed
hellais opened this issue Jun 6, 2013 · 8 comments
Closed

Use JSONVariable instead of Pickle (GL01-00??) #295

hellais opened this issue Jun 6, 2013 · 8 comments

Comments

@hellais
Copy link
Contributor

hellais commented Jun 6, 2013

For security reasons we should probably be storing the variables in the database in JSON form rather than pickle.

Even though we are safely encoding and decoding the content of the pickle with json.loads and json.dumps we could have the ORM handle this transparently and make it less prone to errors.

http://bazaar.launchpad.net/~storm/storm/trunk/view/head:/storm/locals.py#L23

http://bazaar.launchpad.net/~storm/storm/trunk/view/head:/storm/variables.py#L626

This change requires writing also a database migration script that will port the old version of the database to the newer one.

In globaleaks code the change would happen here:
https://github.com/globaleaks/GLBackend/blob/master/globaleaks/models.py#L9

This was suggested by abraham from cure53.

@evilaliv3
Copy link
Member

This seems fine to me also.

@vecna
Copy link
Contributor

vecna commented Jun 27, 2013

this is the start, I would upgrade to JSON with the database version 2 https://github.com/globaleaks/GLBackend/commit/06ddf75bbba002861757d58d8166a0741a060980

@fpietrosanti
Copy link
Contributor

@vecna is now this done as part of multi-language translation?

@fpietrosanti
Copy link
Contributor

applied security tag

@vecna
Copy link
Contributor

vecna commented Jul 12, 2013

DB version since 3 to 4

@ghost ghost assigned vecna Jul 12, 2013
@vecna
Copy link
Contributor

vecna commented Jul 17, 2013

@hellais

Even though we are safely encoding and decoding the content of the pickle with json.loads and json.dumps we
could have the ORM handle this transparently and make it less prone to errors.

but, in the base handler are performed checks inside the decoded JSON, and also some modification of requests are happening at the moment (it's an unclean behavior, because request need to be unchanged by users http-action), the we've just to re-encode in JSON the request dict, and then copy in the ORM ?

@vecna
Copy link
Contributor

vecna commented Aug 28, 2014

@mmaker @hellais @evilaliv3 JSON instead of Pickle. remind of this security task left open since the first PT.

@evilaliv3 evilaliv3 modified the milestones: 2014 December, Backlog Dec 21, 2014
@evilaliv3 evilaliv3 self-assigned this Dec 21, 2014
evilaliv3 added a commit that referenced this issue Dec 21, 2014
@evilaliv3
Copy link
Member

bye, bye, bye my pickles!
I'll be seeing you again
Yeah, I'll be seeing you, in hell

evilaliv3 referenced this issue Aug 4, 2016
Work towards #999

This commit can be tested with:
> trial globaleaks.tests.test_models.TestSystemConfigModels

Please note the use of storm.local.Pickle for raw_value
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants