From 088d388e6d4dda42d9278e6da96ac3183ff09dcd Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Tue, 23 May 2023 00:07:36 +0200 Subject: Enable Security cops Also fixes a Security/Open offense that couldn't be exploited, because the only invocation of `get_mime_type_from_uri` was validating the input with a `URI::DEFAULT_PARSER` regexp --- lib/axlsx/util/mime_type_utils.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/axlsx/util/mime_type_utils.rb b/lib/axlsx/util/mime_type_utils.rb index c2e6909f..fbe39448 100644 --- a/lib/axlsx/util/mime_type_utils.rb +++ b/lib/axlsx/util/mime_type_utils.rb @@ -16,7 +16,7 @@ module Axlsx # @param [String] v URI # @return [String] File mime type def self.get_mime_type_from_uri(v) - Marcel::MimeType.for(URI.open(v)) + Marcel::MimeType.for(URI.parse(v).open) end end end -- cgit v1.2.3