You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by "SEZ9 (via GitHub)" <gi...@apache.org> on 2026/09/03 16:09:59 UTC
[I] [Bug] [Zeta] /submit-job/upload accepts an unbounded multipart body [seatunnel]
SEZ9 opened a new issue, #12068:
URL: https://github.com/apache/seatunnel/issues/12068
### Search before asking
- [X] I had searched in the [issues](https://github.com/apache/seatunnel/issues?q=is%3Aissue+label%3A%22bug%22) and found no similar issues.
### What happened
`POST /submit-job/upload` accepts a multipart body with no size limit, so a single request can fill the master's temp directory and exhaust its heap.
The multipart handling is registered with the single-argument constructor:
https://github.com/apache/seatunnel/blob/dev/seatunnel-engine/seatunnel-engine-server/src/main/java/org/apache/seatunnel/engine/server/JettyService.java
```java
MultipartConfigElement multipartConfigElement = new MultipartConfigElement("");
```
`MultipartConfigElement(String location)` leaves both `maxFileSize` and `maxRequestSize` at their default of `-1`, which Jetty reads as unlimited. The uploaded part is then buffered to disk by Jetty and read into a `String` in full by the servlet:
```java
String content = IOUtils.toString(filePart.getInputStream(), StandardCharsets.UTF_8);
```
So the body is written to the temp directory once and materialised in the heap a second time, at roughly 2 bytes per character. There is no point at which the size is checked.
The endpoint only ever receives job config files, which are kilobytes. Nothing needs the unbounded behaviour, and there is no way to configure a bound today.
### SeaTunnel Version
dev (reproduced by reading the code; the constructor call has been unbounded since the endpoint was added)
### SeaTunnel Config
```conf
seatunnel:
engine:
http:
enable-http: true
port: 8080
```
### Running Command
```shell
# start a Zeta cluster with the config above, then:
dd if=/dev/zero of=/tmp/big.conf bs=1M count=4096
curl --location 'http://127.0.0.1:8080/submit-job/upload' --form 'config_file=@"/tmp/big.conf"'
```
### Error Exception
```log
# the master's temp directory grows by the full size of the body, then:
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:3332)
at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
...
at org.apache.commons.io.IOUtils.toString(IOUtils.java:1087)
at org.apache.seatunnel.engine.server.rest.servlet.SubmitJobByUploadFileServlet.doPost(SubmitJobByUploadFileServlet.java:57)
```
### Zeta or Flink or Spark Version
Zeta
### Java or Scala Version
Java 8 / Java 11
### Screenshots
_No response_
### Are you willing to submit PR?
- [X] Yes I am willing to submit a PR!
### Code of Conduct
- [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
--
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: commits-unsubscribe@seatunnel.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [Zeta] /submit-job/upload accepts an unbounded multipart body [seatunnel]
Posted by "DanielLeens (via GitHub)" <gi...@apache.org>.
DanielLeens commented on issue #12068:
URL: https://github.com/apache/seatunnel/issues/12068#issuecomment-5541704509
Thank you for reporting this. Because it concerns potential resource-exhaustion behavior in an exposed endpoint, please send the complete report and any reproduction details to security@apache.org following the Apache vulnerability-reporting process, and do not add further exploit or deployment details here. Maintainers can coordinate the appropriate handling through that channel.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [Zeta] /submit-job/upload accepts an unbounded multipart body [seatunnel]
Posted by "davidzollo (via GitHub)" <gi...@apache.org>.
davidzollo closed issue #12068: [Bug] [Zeta] /submit-job/upload accepts an unbounded multipart body
URL: https://github.com/apache/seatunnel/issues/12068
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [I] [Bug] [Zeta] /submit-job/upload accepts an unbounded multipart body [seatunnel]
Posted by "CryoThrust (via GitHub)" <gi...@apache.org>.
CryoThrust commented on issue #12068:
URL: https://github.com/apache/seatunnel/issues/12068#issuecomment-5536568246
The upload endpoint currently registers `new MultipartConfigElement("")`, which leaves both `maxFileSize` and `maxRequestSize` unlimited. Since the servlet then materializes the uploaded config with `IOUtils.toString(...)`, this creates both unbounded temp-disk usage and an avoidable heap amplification risk.
I can prepare a focused fix, but would like to confirm the intended contract first:
- Should the limit be a fixed conservative default (for example, 10 MiB) or an engine HTTP configuration option?
- Should the limit apply to the whole multipart request and each uploaded part, with a small file-size threshold for disk buffering?
- Should Jetty's multipart-size rejection be translated to the existing REST 400 error format?
The implementation can remain scoped to `JettyService` plus a regression test that submits a body over the configured limit; no changes to the job submission protocol are required.
--
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: commits-unsubscribe@seatunnel.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org