Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on Apr 1, 2024 via pnpm

http-signature 0.9.2

Reference implementation of Joyent's HTTP Signature Scheme
Package summary
Share
9
issues
4
critical severity
license
4
3
high severity
vulnerability
2
meta
1
2
moderate severity
meta
2
1
license
4
N/A
Package created
14 Jul 2011
Version published
4 Sep 2011
Maintainers
8
Total deps
4
Direct deps
3
License
UNKNOWN

Issues

9

4 critical severity issues

critical
Recommendation: Check the package code and files for license information
via: asn1@0.1.5
Recommendation: Check the package code and files for license information
via: ctype@0.0.3
Recommendation: Check the package code and files for license information
via: http-signature@0.9.2
Recommendation: Check the package code and files for license information
via: sprintf@0.1.1
Collapse
Expand

3 high severity issues

high
Recommendation: Upgrade to version 0.10.0 or later
via: http-signature@0.9.2
Recommendation: Upgrade to version 0.10.0 or later
via: http-signature@0.9.2
via: sprintf@0.1.1
Collapse
Expand

2 moderate severity issues

moderate
via: ctype@0.0.3
via: sprintf@0.1.1
Collapse
Expand

Licenses

N/A

N/A
4 Packages, Including:
asn1@0.1.5
ctype@0.0.3
http-signature@0.9.2
sprintf@0.1.1
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

3
All Dependencies CSV
β“˜ This is a list of http-signature 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
asn10.1.56.65 kBUNKNOWN
prod
1
ctype0.0.333.46 kBUNKNOWN
prod
1
1
sprintf0.1.13.27 kBUNKNOWN
prod
1
1
1

Visualizations

Frequently Asked Questions

What does http-signature do?

HTTP Signature is an npm package offering a node.js library with client and server components for Joyent's HTTP Signature Scheme. This package allows you to authorize and validate incoming HTTP requests based on a signature contained in the HTTP header helping you increase the security of your applications.

How do you use http-signature?

To use the HTTP Signature package, you start by installing it on your node.js project using the npm install command as follows: npm install http-signature.

For client-side usage, you first require the necessary modules and read your private key. Then, you specify your request options, sign the request with your key, and send it.

var fs = require('fs');
var https = require('https');
var httpSignature = require('http-signature');

var key = fs.readFileSync('./key.pem', 'ascii');

var options = {
  host: 'localhost',
  port: 8443,
  path: '/',
  method: 'GET',
  headers: {}
};

//Adds a 'Date' header in, signs it, and adds the Authorization' header in.
var req = https.request(options, function(res) {
  console.log(res.statusCode);
});

httpSignature.sign(req, {
  key: key,
  keyId: './cert.pem',
  keyPassphrase: 'secret' // optional
});

req.end();

For server-side usage, you parse the incoming request and verify its signature. If the signature is verified, then you proceed with handling the request, if not; you respond with an Unauthorized status (401).

var fs = require('fs');
var https = require('https');
var httpSignature = require('http-signature');

var options = {
  key: fs.readFileSync('./key.pem'),
  cert: fs.readFileSync('./cert.pem')
};

https.createServer(options, function (req, res) {
  var rc = 200;
  var parsed = httpSignature.parseRequest(req);
  var pub = fs.readFileSync(parsed.keyId, 'ascii');

  if (!httpSignature.verifySignature(parsed, pub))
    rc = 401;

  res.writeHead(rc);
  res.end();
}).listen(8443);

Where are the http-signature docs?

The official documentation for the HTTP Signature package isn't explicitly mentioned in the readme content, but as it's an open-source project, information regarding the usage and details about the package could be found on their GitHub repository at git://github.com/joyent/node-http-signature.git. Additionally, the code examples provided in the repository are a good resource for understanding how to utilize this package.