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.
Ruby implementation of HTTP Signatures draft specification; cryptographically sign and verify HTTP requests and responses.
See also:
Add http_signatures
to your Gemfile
.
Configure a context with your algorithm, keys, headers to sign. In Rails, this is best placed in an initializer.
require "http_signatures"
$context = HttpSignatures::Context.new(
keys: {"examplekey" => "secret-key-here"},
algorithm: "hmac-sha256",
headers: ["(request-target)", "Date", "Content-Length"],
)
If there's only one key in the keys
hash, that will be used for signing.
Otherwise, specify one via signing_key_id: "examplekey"
.
A message is an HTTP request or response. A subset of the interface of
Ruby's Net::HTTPRequest and Net::HTTPResponse is expected; the ability to
set/read headers via message["name"]
, and for requests, the presence
of message#method
and message#path
for (request-target)
support.
require "net/http"
require "time"
message = Net::HTTP::Get.new(
"/path?query=123",
"Date" => Time.now.rfc822,
"Content-Length" => "0",
)
$context.signer.sign(message)
Now message
contains the signature headers:
message["Signature"]
# keyId="examplekey",algorithm="hmac-sha256",headers="...",signature="..."
message["Authorization"]
# Signature keyId="examplekey",algorithm="hmac-sha256",headers="...",signature="..."
$context.verifier.valid?(message) # => true or false
Pull Requests are welcome.
FAQs
Unknown package
We found that http_signatures 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.