
Research
/Security News
Malicious npm Packages Target WhatsApp Developers with Remote Kill Switch
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Add to your Gemfile:
gem "fix", ">= 1.0.0.beta9"
Then execute:
bundle install
Or install it yourself:
gem install fix --pre
Specifications for a Duck
class:
# examples/duck/fix.rb
require "fix"
Fix :Duck do
it SHOULD be_an_instance_of :Duck
on :swims do
it MUST be_an_instance_of :String
it MUST eql "Swoosh..."
end
on :speaks do
it MUST raise_exception NoMethodError
end
on :sings do
it MAY eql "♪... ♫..."
end
end
Implementing the Duck
class:
# examples/duck/app.rb
class Duck
def walks
"Klop klop!"
end
def swims
"Swoosh..."
end
def quacks
puts "Quaaaaaack!"
end
end
Running the test:
# examples/duck/test.rb
require_relative "app"
require_relative "fix"
Fix[:Duck].test { Duck.new }
Execute:
ruby examples/duck/test.rb
Expected output:
(irb):3 Success: expected #<Duck:0x00007fb2fa208708> to be an instance of Duck.
(irb):7 Success: expected to eq "Swoosh...".
(irb):15 NoMethodError: undefined method `sings' for #<Duck:0x00007fb2fd8371d0>.
(irb):6 Success: expected "Swoosh..." to be an instance of String.
(irb):11 Success: undefined method `speaks' for #<Duck:0x00007fb2fcc79258>.
Fix follows Semantic Versioning 2.0.
The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that fix demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Two npm packages masquerading as WhatsApp developer libraries include a kill switch that deletes all files if the phone number isn’t whitelisted.
Research
/Security News
Socket uncovered 11 malicious Go packages using obfuscated loaders to fetch and execute second-stage payloads via C2 domains.
Security News
TC39 advances 11 JavaScript proposals, with two moving to Stage 4, bringing better math, binary APIs, and more features one step closer to the ECMAScript spec.