Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
@aws-sdk/signature-v4
Advanced tools
A standalone implementation of the AWS Signature V4 request signing algorithm
@aws-sdk/signature-v4 is a package from the AWS SDK for JavaScript that provides functionality to sign AWS requests using the Signature Version 4 signing process. This is essential for securely making authenticated requests to AWS services.
Signing HTTP Requests
This feature allows you to sign HTTP requests to AWS services using the Signature Version 4 signing process. The code sample demonstrates how to sign a GET request to an S3 bucket.
const { SignatureV4 } = require('@aws-sdk/signature-v4');
const { Sha256 } = require('@aws-crypto/sha256-js');
const { HttpRequest } = require('@aws-sdk/protocol-http');
const signer = new SignatureV4({
service: 's3',
region: 'us-east-1',
credentials: {
accessKeyId: 'AKID',
secretAccessKey: 'SECRET'
},
sha256: Sha256
});
const request = new HttpRequest({
method: 'GET',
hostname: 'examplebucket.s3.amazonaws.com',
path: '/exampleobject'
});
signer.sign(request).then(signedRequest => {
console.log(signedRequest);
});
Presigning URLs
This feature allows you to generate presigned URLs for AWS services, which can be used to grant temporary access to resources. The code sample demonstrates how to presign a URL for an S3 object.
const { S3RequestPresigner } = require('@aws-sdk/s3-request-presigner');
const { HttpRequest } = require('@aws-sdk/protocol-http');
const { Hash } = require('@aws-sdk/hash-node');
const { formatUrl } = require('@aws-sdk/util-format-url');
const presigner = new S3RequestPresigner({
credentials: {
accessKeyId: 'AKID',
secretAccessKey: 'SECRET'
},
region: 'us-east-1',
sha256: Hash.bind(null, 'sha256')
});
const request = new HttpRequest({
method: 'GET',
hostname: 'examplebucket.s3.amazonaws.com',
path: '/exampleobject'
});
presigner.presign(request).then(presignedUrl => {
console.log(formatUrl(presignedUrl));
});
The aws4 package is a lightweight library for signing AWS requests with Signature Version 4. It is simpler and has fewer dependencies compared to @aws-sdk/signature-v4, making it a good choice for smaller projects or environments with limited resources.
The aws-signature-v4 package is another library for signing AWS requests using Signature Version 4. It is designed to be compatible with both Node.js and browser environments, similar to @aws-sdk/signature-v4, but it may not be as feature-rich or tightly integrated with the AWS SDK.
3.374.0 (2023-07-20)
FAQs
A standalone implementation of the AWS Signature V4 request signing algorithm
The npm package @aws-sdk/signature-v4 receives a total of 1,749,673 weekly downloads. As such, @aws-sdk/signature-v4 popularity was classified as popular.
We found that @aws-sdk/signature-v4 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers 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
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.