slachiewicz opened a new issue, #3619:
URL: https://github.com/apache/maven-surefire/issues/3619
Affected version: master at d7c7e359e.
`ModularClasspathForkConfiguration.createArgsFile`
(maven-surefire-common/src/main/java/org/apache/maven/plugin/surefire/booterclient/ModularClasspathForkConfiguration.java:131-225)
writes one JVM option per line into a temporary `@argfile`. Classpath entries
are escaped only by replacing backslashes; module names and packages come from
`javaModuleDescriptor.name()` and scanned test classes, and
`providerJpmsArguments` are appended raw. Newlines and quotes are not escaped
or rejected, so a value containing a newline can split into additional JVM
options.
The fork JVM is launched with `cli.createArg().setValue("@" + argsFile)`
through a no-shell `ProcessBuilder`, so this does not become an OS command
injection, but it can change the forked JVM's options unexpectedly (for example
when a module descriptor or provider argument contains a control character).
Expected behavior: reject or escape CR, LF, and quote characters for every
value written to the arg file, with a regression test in
`ModularClasspathForkConfigurationTest`.
--
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]