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.
EMRPC is a EventMachine-based remote procedure call library. It looks like DRb, but is much more efficient and provides asynchronous erlang-like interface along with blocking synchronous interface.
Author: Oleg Andreev oleganza@gmail.com
FEATURES
VERSION AND STATUS
This is v0.3 alpha. It is being used in several projects of my own, but is not tested on many interesting cases. It has also several issues with performance and specs stability (see TODO file).
THANKS TO
EXAMPLES
You may try out examples using bin/emrpc IRB session. Just open the console and paste the code.
HELLO WORLD (BLOCKING API)
class HelloWorld def action "Hello!" end end
server = EMRPC::Server.new(:address => 'emrpc://localhost:4000/', :backend => HelloWorld.new) EM::safe_run(:background) { }
server.start
client = EMRPC::Client.new('emrpc://localhost:4000/') client.action == "Hello!" #=> true
HELLO WORLD (EVENTED API)
class HelloWorld include Pid def action(sender) puts "HelloWorld replies to the sender #{sender}..." sender.reply(self, "Hello!") end end
class User include Pid def connected(pid) puts "Pid #{pid} connected with the user." pid.action(self) end def reply(pid, msg) puts "Pid #{pid} replied: #{msg}" end end
EM::run do hw = HelloWorld.new hw.bind('emrpc://localhost:4000/') # bind a pid to the address
oleg = User.new
oleg.connect('emrpc://localhost:4000/') # connect to that address
end
Pid #EMRPC::RemotePid:0x143b740 connected with the user. HelloWorld replies to the sender #User:0x143b4d4... Pid #HelloWorld:0x143d540 replied: Hello!
HELLO WORLD (EVENTED WRAPPER, MIXED API)
class HelloWorld def action "Hello!" end end
server = EMRPC::Server.new(:address => 'emrpc://localhost:4000/', :backend => HelloWorld.new)
EM::run do server.start end
class User include Pid def connected(pid) puts "Pid #{pid} connected to the user." pid.send(self, :action) end def on_return(pid, msg) puts "Pid #{pid} replied: #{msg}" end end
EM::run do oleg = User.new oleg.connect('emrpc://localhost:4000/') # connect to that address end
Pid #EMRPC::RemotePid:0x143b740 connected to the user. Pid #HelloWorld:0x143d540 replied: Hello!
FAQs
Unknown package
We found that oleganza-emrpc 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.