Benign gem 1,344,504 installs Download

miasma 0.2.32

Legitimate API client gem

“Smoggy API”

Code embeds cleartext HTTP URL literalReferences a public code-forge URL
SHA-25632bf7137a80fb58e5f02dd9b683e0f5c0cb8e58ea8a54835414dcdfdf2ca8c04

Evidence

Enumerates files with a recursive Ruby glob miasma-test · lines 20–32
20:27… led to locate expected spec directory! (#{library_spec_dir})"
21 exit -1
22end
23
24if(ARGV.empty?)
25 cassette_directory = File.join(library_spec_dir, 'cassettes')
26
27 Dir.glob(File.join(library_spec_dir, '**/**/*_spec.rb')).each do |path|
28 require File.expand_path(path)
29 end
30
31else
32 cassette_directory = File.join(library_spec_dir, ' …
Ruby creates a directory tree miasma-test · lines 39–51
⋯5 lines
44end
45
46FileUtils.mkdir_p(cassette_directory)
47
48VCR.configure do |c|
49 c.cassette_library_dir = cassette_directory
50 c.hook_into :webmock
51end
Ruby dynamically resolves a constant resource.rb · lines 30–38
30:37… , 2)
31 # Insert mapping constant name and fetch
32 const = provider_const.push(:RESOURCE_MAPPING).inject(Object) do |memo, konst|
33 res = memo.const_get(konst)
34 break unless res
35 res
36 end
37 unless(const[self.type])
38 …
Ruby rebinds a method with alias_method resource.rb · lines 46–57
46 def expand
47 info = dereference
48 api.api_for(info[:api]).send(info[:collection]).get(self.id)
49 end
50 alias_method :instance, :expand
51
52 # Proxy reload action up to the API
53 def perform_reload
54 api.resource_reload(self)
55 end
56
57 …
Ruby dynamically invokes a method with send file.rb · lines 25–33
25:52… lock)
26 if(io.respond_to?(method_name))
27 io.send(method_name, *args, &block)
28 else
29 raise
⋯4 lines

No evidence locations were recorded for this file. Raw result

Keyboard shortcuts on this page: j for the next sample, k for the previous one, x to go back to the feed, d to download the original bytes, r to re-queue the sample for analysis.