Skip to content

Conversation

@plamentotev
Copy link
Member

Runtime.getRuntime().exec( "chmod 440 " + causes
security warnings because it concatenates arguments
(there is a risk of argument injection).

The argument does not come from untrusted source,
but as we can use Java to change a file mode, it is
better to remove the chmod invocation altogether.
chmod was necessary before Java 7 as there
was no support for changing file modes.

`Runtime.getRuntime().exec( "chmod 440 " + ` causes
security warnings because it concatenates arguments
(there is a risk of argument injection).

The argument does not come from untrusted source,
but as we can use Java to change a file mode, it is
better to remove the `chmod` invocation altogether.
`chmod` was necessary before Java 7 as there
was no support for changing file modes.
@plamentotev plamentotev added this to the plexus-archiver-4.2.6 milestone May 1, 2021
@plamentotev plamentotev merged commit 526b859 into master May 1, 2021
@plamentotev plamentotev deleted the fix-security-warnings branch May 1, 2021 15:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants