Summary
The expected protocDigest is ignored when protoc is taken from the PATH.
Details
The documentation for the protocDigest parameter says:
... Users may wish to specify this if using a PATH-based binary ...
However, when specifying <protoc>PATH</protoc> the protocDigest is not actually checked because the code returns here already
|
if (version.equalsIgnoreCase("PATH")) { |
|
return systemPathResolver.resolve(EXECUTABLE_NAME); |
|
} |
before the digest check:
PoC
Specify:
<protoc>PATH</protoc>
<protocDigest>sha256:0000000000000000000000000000000000000000000000000000000000000000</protocDigest>
And notice how the protoc on the PATH is not rejected, despite a digest mismatch.
Impact
Users who have an untrusted protoc executable on their PATH and rely <protocDigest> as protection are affected.
Summary
The expected
protocDigestis ignored when protoc is taken from thePATH.Details
The documentation for the
protocDigestparameter says:However, when specifying
<protoc>PATH</protoc>theprotocDigestis not actually checked because the code returns here alreadyprotobuf-maven-plugin/protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/protoc/ProtocResolver.java
Lines 91 to 93 in 59097aa
before the digest check:
protobuf-maven-plugin/protobuf-maven-plugin/src/main/java/io/github/ascopes/protobufmavenplugin/protoc/ProtocResolver.java
Line 106 in 59097aa
PoC
Specify:
And notice how the
protocon thePATHis not rejected, despite a digest mismatch.Impact
Users who have an untrusted
protocexecutable on theirPATHand rely<protocDigest>as protection are affected.