Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
= safer
== DESCRIPTION:
Safer is an umbrella library, with components designed to make it simple to verify and improve the safety of your ruby code. There are at present three modules under the safer umbrella:
[Safer::IVar] generates specially-named accessor functions for class instance variables. [Safer::Protocol] is used to provide a ruby analogue to Objective-C Protocols (which are similar to Java interfaces, but do not require inheritance). [Safer::HashProtocol] verifies that a Hash keys follow a defined format. Intended to help use of Hash objects as keyword parameters.
== FEATURES/PROBLEMS:
== SYNOPSIS:
require 'safer/ivar' require 'safer/protocol' require 'safer/hashprotocol'
module MyModule class MyProtocolClass def self.class_method_foo(arg1, arg2) end def instance_method(arg3) end end PROTOCOL = Safer::Protocol.create_from_class(MyProtocolClass) class MyClass Safer::IVar.instance_variable(self, :var1, :var2) def initialize(var1, var2) PROTOCOL.instance_conforms?(var1) PROTOCOL.instance_conforms?(var2) self.mymodule_myclass__var1 = var1 self.mymodule_myclass__var2 = var2 end
SHP = Safer::HashProtocol
V1Keywords = SHP::HasKey.create(:name, :type)
V2Keywords = SHP::HasKey.create(:first, :last, :type)
V1Check = SHP::Only.new(SHP::Any.new(*V1Keywords))
V2Check = SHP::Only.new(SHP::Any.new(*V2Keywords))
ValidCheck = SHP::Any.new(V1Check, V2Check)
def my_fn(h)
if ! (ValidCheck === h)
raise ArgumentError, "h should conform to #{ValidCheck.description}"
end
case h
when V1Check
v1_process(h[:name], h[:type])
when V2Check
v2_process(h[:first], h[:last], h[:type])
end
end
end
end
== REQUIREMENTS:
== INSTALL:
== DEVELOPERS:
After checking out the source, run:
$ rake newb
This task will install any missing dependencies, run the tests/specs, and generate the RDoc.
== LICENSE:
This software is placed into the public domain.
FAQs
Unknown package
We found that safer 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.