You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2025/03/23 09:21:02 UTC
(httpcomponents-client) 02/02: Adjust comments
This is an automated email from the ASF dual-hosted git repository.
olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git
commit cd3d69d4b35ca0403fef6ec49510ac3b77d380c4
Author: Ben Shonaldmann <be...@benweissmann.com>
AuthorDate: Tue Mar 18 10:01:18 2025 -0400
Adjust comments
---
.../hc/client5/http/entity/mime/MultipartEntityBuilder.java | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartEntityBuilder.java b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartEntityBuilder.java
index 3cb4f1774..de16e98c2 100644
--- a/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartEntityBuilder.java
+++ b/httpclient5/src/main/java/org/apache/hc/client5/http/entity/mime/MultipartEntityBuilder.java
@@ -50,6 +50,12 @@
* This class constructs multipart entities with a boundary determined by either a random UUID
* or an explicit boundary set via {@link #setBoundary(String)}.
* </p>
+ * <p>
+ * IMPORTANT: it is responsibility of the caller to validate / sanitize content of body
+ * parts. For instance, when using an explicit boundary, it's the caller's responsibility to
+ * ensure the body parts do not contain the boundary value, which can prevent the consumer of
+ * the entity from correctly parsing / processing the body parts.
+ * </p>
*
* @since 5.0
*/
@@ -228,8 +234,8 @@ public MultipartEntityBuilder addBinaryBody(final String name, final InputStream
* Generates a random boundary using UUID. The UUID is a v4 random UUID generated from a cryptographically-secure
* random source.
* <p>
- * A cryptographically-secure random number source is used to avoid security issues similar to
- * CVE-2025-22150 (affecting the Node.JS ecosystem).
+ * A cryptographically-secure random number source is used to generate the UUID, to avoid a malicious actor crafting
+ * a body part that contains the boundary value to tamper with the entity structure.
* </p>
*/
private String getRandomBoundary() {