Shawyeok opened a new pull request, #3982:
URL: https://github.com/apache/bookkeeper/pull/3982

   ### Motivation
   
   There is a potential arbitrary file upload vulnerability with 
`httpServerEnabled=true`, it's caused by `BodyHandler.create()` which returns a 
BodyHandler that automatically processes file upload requests.
   
https://github.com/apache/bookkeeper/blob/7f64246ad38981126cc8dd929ff448805a738b8f/bookkeeper-http/vertx-http-server/src/main/java/org/apache/bookkeeper/http/vertx/VertxHttpServer.java#L82
   
   This simple command will upload a file into the `file-uploads` directory 
under the bookkeeper server process `CWD`.
   ```shell
   $ curl -i --request POST \
     --url http://localhost:8000/api/v1/bookie/info \
     --header 'Content-Type: multipart/form-data' \
     --form file=@<a-path-of-the-file>
   
   $ ls
   LICENSE  NOTICE  README.md  bin  conf  deps  file-uploads  lib  logs  scripts
   $ ls file-uploads
   758801ba-ea1e-49e3-85d6-e510f539ea0d
   ```
   
   ### Changes
   
   Create the `BodyHandler` with handleFileUploads disabled 
(`BodyHandler.create(false)`).


-- 
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]

Reply via email to