Skip to content
This repository has been archived by the owner on Feb 12, 2023. It is now read-only.

Security fixes #303

Merged
merged 13 commits into from Sep 11, 2018
Merged

Security fixes #303

merged 13 commits into from Sep 11, 2018

Conversation

ggalmazor
Copy link
Contributor

@ggalmazor ggalmazor commented Aug 17, 2018

This PR adds extra security protections to some RPC calls:

  • Change users from Site Admin > Edit Users
  • Delete a form
  • Delete submission
  • Purge published data
  • Purge submissions

What has been done to verify that this works as intended?

First, I've manually verified that all these operations still work in my local Aggregate instance
Second, I've inspected the network interchange of the delete form action and I've resent it using curl from the command line to verify that it won't work since the CSRF token wasn't valid anymore.

Why is this the best possible solution? Were any other approaches considered?

This solution implements the official instructions to add CSRF protection to GWT apps.

To reduce code duplication and complexity, I've created a wrapper that handles client-side CSRF requests.

Are there any risks to merging this code? If so, what are they?

Any third party hitting these RPCs will have to request a CSRF token before making them.

Do we need any specific form for testing your changes? If so, please attach one

No.

Does this change require updates to documentation? If so, please file an issue at https://github.com/opendatakit/docs/issues/new and include the link below.

No.

@dcbriccetti
Copy link
Contributor

So far this looks good, but as someone who is only marginally able to run Aggregate (and even then with tons of errors on startup that don’t seem to break the features I need for running Briefcase), I can’t vet this change with confidence in my ability to understand it.

@ggalmazor
Copy link
Contributor Author

Thanks, @dcbriccetti!

};
}

;
Copy link
Contributor

Choose a reason for hiding this comment

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

By reformatting the code and exposing these unnecessary semicolons—I count ten—you acquire the responsibility of deleting them. 😀

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wonder how on earth did I miss those! Removing them :)

@kkrawczyk123
Copy link

I am not sure about purging process so I reported a new issue #307. Confirm that other process works.
@opendatakit-bot unlabel "needs testing"

@lognaturel lognaturel merged commit b277f9a into getodk:master Sep 11, 2018
@ggalmazor ggalmazor deleted the security_fixes branch September 11, 2018 06:41
@ggalmazor ggalmazor mentioned this pull request Oct 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants