
Security News
Nx npm Packages Compromised in Supply Chain Attack Leveraging AI CLI Tools
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
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.
Security News
Malicious Nx npm versions stole secrets and wallet info using AI CLI tools; Socket’s AI scanner detected the supply chain attack and flagged the malware.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.