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

Add random string to submission filenames for better hiding #1005

Merged
merged 2 commits into from
Oct 6, 2018

Conversation

rkdarst
Copy link
Contributor

@rkdarst rkdarst commented Aug 22, 2018

  • Previously, the exchange was writeable by all users, readable by all
    users, but only listable by the instructors. Non-guessability of
    the filename is the method of security. However, filenames are a
    function of (username, assignment_id, and microsecond timestamp). A
    microsecond timestamp alone is not immediately guessable, but not
    perfect either.
  • This patch introduces a random string to the submission filename.
  • This is backwards compatible, except if there is a "+" in a username
    and the instructor uses new nbgrader and students submit with old
    nbgrader. This is because "+" is used to split the path components,
    but is also a valid character for usernames. It was split with
    .rsplit("+", 2) before, now it is .rsplit("+", 3).
  • Related: Students able to access others' submissions? #978
  • Closes: Students able to access others' submissions? #978

The non-extension tests work locally, let's see what travis says for the rest...

- Previously, the exchange was writeable by all users, readable by all
  users, but only listable by the instructors.  Non-guessability of
  the filename is the method of security.  However, filenames are a
  function of (username, assignment_id, and microsecond timestamp).  A
  microsecond timestamp alone is not immediately guessable, but not
  perfect either.
- This patch introduces a random string to the submission filename.
- This is backwards compatible, except if there is a "+" in a username
  and the instructor uses new nbgrader and students submit with old
  nbgrader.  This is because "+" is used to split the path components,
  but is also a valid character for usernames.  It was split with
  .rsplit("+", 2) before, now it is .rsplit("+", 3).
- Related: jupyter#978
- Closes: jupyter#978
- Otherwise, when parsing the cache, the pattern is bad
@jhamrick jhamrick added the bugfix label Oct 6, 2018
@jhamrick jhamrick added this to the 0.6.0 milestone Oct 6, 2018
@jhamrick
Copy link
Member

jhamrick commented Oct 6, 2018

Awesome, thanks!

@jhamrick jhamrick merged commit 61f6e86 into jupyter:master Oct 6, 2018
@rkdarst
Copy link
Contributor Author

rkdarst commented Oct 6, 2018 via email

@jhamrick
Copy link
Member

jhamrick commented Oct 6, 2018

Oh, you're right, it actually is being used by nbgrader list. I think the effect will be that the timestamps will be messed up when running nbgrader list which isn't a huge deal but is still a bug. So we should definitely make another PR to address that, too. Let me know if you'd like to do this, or if I should!

@rkdarst rkdarst deleted the submit_random_timestamp branch December 31, 2018 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants