Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
MultipartFormDataBuilder and AdminActions.doUpload now give their commons-fileupload2 DiskFileItemFactory the servlet context's private temp directory (ServletContext.TEMPDIR), which is also where the container's own multipart parsing spills. both built the factory with no location, so fileupload2 2.0.0-M5 wrote any part over its 10 KB threshold to java.io.tmpdir/upload__.tmp through a plain Files.newOutputStream, leaving the mode to the umask: with the usual 022 the upload is rw-r--r-- in a directory every local account can list. the builder is registered for multipart/form-data in the shipped axis2.xml files and the spring boot starter's soap config, AxisServlet hands it any anonymous multipart POST to a /services/ url through RESTUtil.processXMLRequest, and a file part stays on disk until the item behind the service's DataHandler is collected; for a spring boot deployment java.io.tmpdir is the shared /tmp (CWE-377/CWE-732, the class of netty CVE-2021-21290). the admin console upload built the same factory, and an aar can carry services.xml credentials or a keystore. where a container does not publish TEMPDIR the library default is kept. MultipartFormDataBuilderTest gains a case that fails on master (the part lands in java.io.tmpdir) and passes with the change, and a standalone run under umask 022 showed the part written rw-r--r-- into the shared temp dir before and into the rwx------ context temp dir after. kernel (499 tests), transport-http (114) and webapp verify with -Papache-release, kernel and webapp also build on release 21 and 25, and the webapp integration tests (13, including the admin upload and redeploy) pass.