-
Notifications
You must be signed in to change notification settings - Fork 2.8k
[ZEPPELIN-6190] Prevent directory escape bypass through repeated URL decoding #4891
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
Conversation
cc @jongyoul |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few minor comments. The five attempts seem quite random. But I think it's good that an error message is thrown afterwards.
zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
Outdated
Show resolved
Hide resolved
zeppelin-server/src/main/java/org/apache/zeppelin/service/NotebookService.java
Outdated
Show resolved
Hide resolved
@Reamer Thank you for the feedback! I've added a commit based on your feedback. I agree that using five attempts feels somewhat arbitrary. However I couldn't think of a better alternative, so I went with this value. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, let's wait for CI
I read the change and understand what it does, but I don't understand why should this change. |
I agree with @pan3793 . Please create a Jira ticket and adjust the pull request description accordingly. |
For context: this PR was based on a security issue I received from @jongyoul, but I didn't have a Jira ticket at the time, which may have caused some confusion. Apologies for the earlier lack of clarity - I've now created ZEPPELIN-6190 and linked this PR to it. |
…decoding ### What is this PR for? This PR addresses an issue in `NotebookService` where the notebook path validation only performs a single decoding pass. This allowed a malicious user to bypass validation by double-encoding the `".."` token. By implementing the repeated decoding, we can prevent this bypass. Additionally, to prevent excessive decoding attempts, a maximum limit on the number of decoding attempts has been added. ### What type of PR is it? Hot Fix ### What is the Jira issue? https://issues.apache.org/jira/projects/ZEPPELIN/issues/ZEPPELIN-6190 ### How should this be tested? * CI ### Questions: * Does the license files need to update? No * Is there breaking changes for older versions? * There may be minor compatibility issues if a user relies on multiple encoded paths, but this is unlikely in realistic scenarios. * Does this needs documentation? No Closes #4891 from tbonelee/fix-validating-note-path. Signed-off-by: Philipp Dallig <[email protected]>
Merged into master and branch-0.12 |
What is this PR for?
This PR addresses an issue in
NotebookService
where the notebook path validation only performs a single decoding pass.This allowed a malicious user to bypass validation by double-encoding the
".."
token.By implementing the repeated decoding, we can prevent this bypass.
Additionally, to prevent excessive decoding attempts, a maximum limit on the number of decoding attempts has been added.
What type of PR is it?
Hot Fix
What is the Jira issue?
https://issues.apache.org/jira/projects/ZEPPELIN/issues/ZEPPELIN-6190
How should this be tested?
Questions: