Skip to content
Draft
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/omnibus/fetchers/net_fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -285,10 +285,16 @@
#
def verify_checksum!
log.info(log_key) { "Verifying checksum" }


# Check if the source is a Git repository
if source[:url] =~ %r{git@|https?:\/\/.*\.git}

Check failure

Code scanning / CodeQL

Polynomial regular expression used on uncontrolled data High

This
regular expression
that depends on a
library input
may run slow on strings starting with 'http://' and with many repetitions of 'http://'.
This
regular expression
that depends on a
library input
may run slow on strings starting with 'http://' and with many repetitions of 'http://'.
log.warn(log_key) { "Skipping checksum verification for Git source: #{source[:url]}" }
return
end

expected = checksum
actual = digest(downloaded_file, digest_type)

actual = digest(downloaded_file, digest_type)
if expected != actual
raise ChecksumMismatch.new(self, expected, actual)
end
Expand Down