bito-code-review[bot] commented on PR #44310:
URL: https://github.com/apache/superset/pull/44310#issuecomment-5681961214
<!-- Bito Reply -->
The security concern is valid. The current implementation of
`send_export_zip` (as seen in the test cases) sets a cookie using the provided
token without validating that the token name is safe, which could allow an
attacker to overwrite arbitrary cookies like `session`.
To resolve this, you should validate the `token` against a whitelist of
allowed cookie names or ensure it does not match sensitive application cookies
before setting it.
Since the provided context is limited to the test suite and the API usage, I
recommend updating `send_export_zip` in `superset/utils/core.py` to include a
check:
```python
# Example validation logic to add to send_export_zip
if token and token.isalnum(): # Ensure token is safe
response.set_cookie(token, "done", max_age=600)
```
I have not found any other comments in the provided PR review file. Would
you like me to perform a deeper analysis of the codebase to identify other
potential security issues?
**superset/utils/core.py**
```
if token and token.isalnum(): # Ensure token is safe
response.set_cookie(token, "done", max_age=600)
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]