fix signature verification bypass due to insufficient hashsum checking #212
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The hashsum call is done inside a subshell, hence the error logging
which is responsible for terminating the application on failure must be
chained to the subshell instead of the inner command. Chaining it to the
call inside the subshell would only terminate the subshell ungracefully,
but would not have any effect on the caller.
This effectively is equal to a full signature verification bypass, since
an attacker is able to swap the terraform zip file at will as long as
the hashsum file and the signature are kept unchanged. Before this patch
the installation routine would happily verify the signature of the
hashsum file, the hashsum check in the subshell would fail but the
system wide installation would still take place.
Fixes: 750a849 (Upgrade to logging, keybase, use of local temp dir)
Since: v0.4.3
Signed-off-by: Levente Polyak [email protected]