Skip to content

Conversation

@karriebear
Copy link
Contributor

Issue: #2418

Description: Previously, when receiving a request, we check if a session ID is available or not. If one is provided, we add the file to the file manager. Only when we trigger a rerun will we validate if the session the files are saved under is a valid session. With this change, we will only save the file if the session is valid. This is to provide some additional security when XSRF protections are disabled.


Contribution License Agreement

By submitting this pull request you agree that all contributions to this project are made under the Apache 2.0 license.

@karriebear karriebear requested a review from a team December 21, 2020 21:00
Copy link
Collaborator

@kantuni kantuni left a comment

Choose a reason for hiding this comment

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

Mostly curious about this.setState({ files: this.state.files })

@karriebear karriebear force-pushed the file-uploader-session-check branch 3 times, most recently from 42384dc to ccbe1f8 Compare December 22, 2020 17:55
@karriebear karriebear force-pushed the file-uploader-session-check branch from ccbe1f8 to 65689ae Compare December 22, 2020 17:57
The server's singleton UploadedFileManager. All file uploads
go here.
get_session_info: Server.get_session_info. Used to validate session IDs
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Forget what we decided on regarding comments and typing

Copy link
Collaborator

@kantuni kantuni left a comment

Choose a reason for hiding this comment

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

LGTM!

@karriebear karriebear merged commit 67f2fb2 into streamlit:develop Dec 22, 2020
tconkling added a commit to tconkling/streamlit that referenced this pull request Jan 4, 2021
* develop:
  Bump vega from 5.17.1 to 5.17.3 in /frontend (streamlit#2541)
  Pick a random emoji on `st.set_page_config(emoji="random")` (streamlit#2020)
  Fix Jest warnings (streamlit#2523)
  Upgrade react-markdown (streamlit#2527)
  Upgrade react-hotkeys (streamlit#2525)
  Close streamlit#2495 (streamlit#2524)
  Remove unnecessary case statement (streamlit#2522)
  Bump @types/node from 12.19.9 to 14.14.16 in /frontend (streamlit#2526)
  Bump fetch-mock from 7.7.3 to 9.11.0 in /frontend (streamlit#2505)
  st.markdown now shows a link title (streamlit#2518)
  Bump @types/react-dom from 16.9.10 to 17.0.0 in /frontend (streamlit#2503)
  Fix caching list comprehensions (streamlit#2484)
  Add validation to st.slider ensuring `step` cannot be 0 (streamlit#2502)
  Ensure st.image works with UploadedFiles (streamlit#2512)
  Fix dataframe column sort (streamlit#2511)
  File uploader session check (streamlit#2498)
  Upgrade node-notifier to 8.0.1 or later (streamlit#2507)
  Fix st.number_input not using min_value as default value (streamlit#2499)
  Unblock Core patches, and add Marisa as a docs owner (streamlit#2501)
  Patch 0.73.1 (streamlit#2500)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants