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 a safe version of CLStaticHttpHandler that disallows path traversal. #13124

Merged
merged 1 commit into from
May 11, 2024

Conversation

mayankshriv
Copy link
Contributor

@mayankshriv mayankshriv commented May 10, 2024

Added a safe version of CLStaticHttpHandler that disallows path traversal exploits.
This is now being used for swaggerui-dist.

@codecov-commenter
Copy link

codecov-commenter commented May 10, 2024

Codecov Report

Attention: Patch coverage is 31.57895% with 13 lines in your changes are missing coverage. Please review.

Project coverage is 62.16%. Comparing base (59551e4) to head (b5bc7f6).
Report is 432 commits behind head on master.

Files Patch % Lines
...che/pinot/common/utils/PinotStaticHttpHandler.java 0.00% 8 Missing ⚠️
...pinot/broker/broker/BrokerAdminApiApplication.java 50.00% 4 Missing ⚠️
...apache/pinot/minion/MinionAdminApiApplication.java 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master   #13124      +/-   ##
============================================
+ Coverage     61.75%   62.16%   +0.40%     
+ Complexity      207      198       -9     
============================================
  Files          2436     2515      +79     
  Lines        133233   137862    +4629     
  Branches      20636    21326     +690     
============================================
+ Hits          82274    85696    +3422     
- Misses        44911    45772     +861     
- Partials       6048     6394     +346     
Flag Coverage Δ
custom-integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration <0.01% <0.00%> (-0.01%) ⬇️
integration1 <0.01% <0.00%> (-0.01%) ⬇️
integration2 0.00% <0.00%> (ø)
java-11 62.12% <31.57%> (+0.41%) ⬆️
java-21 62.05% <31.57%> (+0.42%) ⬆️
skip-bytebuffers-false 62.14% <31.57%> (+0.39%) ⬆️
skip-bytebuffers-true 62.02% <31.57%> (+34.30%) ⬆️
temurin 62.16% <31.57%> (+0.40%) ⬆️
unittests 62.15% <31.57%> (+0.40%) ⬆️
unittests1 46.80% <0.00%> (-0.09%) ⬇️
unittests2 27.76% <31.57%> (+0.03%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@abhioncbr
Copy link
Contributor

Hi, just to mention, I am working on one of the issues along with the little refactoring around swagger-ui itself. refactoring includes the bean creation part. If this bugfix is not urgent, I can incorporate the change in refactoring itself. Here is the draft PR for reference

@mayankshriv mayankshriv force-pushed the swagger-fix branch 2 times, most recently from c1e78f6 to bd827d7 Compare May 10, 2024 21:28
@mayankshriv mayankshriv changed the title Add docRoot param to swaggerui-dist handler. Add a safe version of CLStaticHttpHandler that disallows path traversal. May 10, 2024
@mayankshriv
Copy link
Contributor Author

Hi, just to mention, I am working on one of the issues along with the little refactoring around swagger-ui itself. refactoring includes the bean creation part. If this bugfix is not urgent, I can incorporate the change in refactoring itself. Here is the draft PR for reference

Hi, thanks for letting me know. This is kind of urgent as it is fixing path traversal issue. But the changes themselves are quite simple so shouldn't cause much issue with your refactor.

@mayankshriv mayankshriv force-pushed the swagger-fix branch 2 times, most recently from 0f34442 to 492b8ab Compare May 10, 2024 22:21
…rsal.

Added a safe version of `CLStaticHttpHandler` that disallows path traversal exploits.
This is now being used for `swaggerui-dist`.
Copy link

@sar12332111 sar12332111 left a comment

Choose a reason for hiding this comment

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

LGTM!

@mayankshriv mayankshriv merged commit c32a4a2 into apache:master May 11, 2024
20 checks passed
@mayankshriv mayankshriv deleted the swagger-fix branch May 11, 2024 00:52
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.

5 participants