
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Sapient secures your Node.js applications' server-to-server HTTP(S) traffic even in the wake of a TLS security breakdown (compromised certificate authority, etc.).
Sapient allows you to quickly and easily add application-layer cryptography to your API requests and responses.
npm install --save sapient
Optional:
Sapient uses Sodium-Plus internally.
The default Sodium-Plus backend is cross-platform, but you can obtain greater
performance by installing sodium-native
too.
npm install --save sodium-native
This isn't strictly necessary, and sodium-native doesn't work in browsers, but if you're not targeting browsers, you can get a significant performance boost.
See the request-promise documentation.
To use Sapient, you'll simply need to preprocess your options
objects.
const rp = require('request-promise-native');
const {Sapient, SigningSecretKey} = require('sapient');
(async function () {
let sk = await SigningSecretKey.generate();
let request = {
'method': 'POST',
'uri': 'https://example.com',
'form': {
'important': 'some value that needs integrity',
'test': 12345,
'now': '2019-07-31T09:00:00+00:00'
}
};
let response = await rp(await Sapient.signFormRequest(request, sk));
console.log(response.statusCode);
try {
await Sapient.verifySignedResponse(response, sk.getPublicKey());
} catch (e) {
console.log(e.message);
}
})();
This code will fetch data from the PHP Chronicle, verify the signature, return an object representing the JSON data that we authenticated.
const rp = require('request-promise-native');
const {Sapient, SigningPublicKey} = require('sapient');
(async function () {
let publicKey = SigningPublicKey.fromString(
'MoavD16iqe9-QVhIy-ewD4DMp0QRH-drKfwhfeDAUG0='
);
let request = {
'method': 'GET',
'uri': 'https://php-chronicle.pie-hosted.com/chronicle/lookup/WQG3tH3CiLHg_upN0ABhKiYWOGwH3n9l4pM04bXwG54=',
'resolveWithFullResponse': true
};
let response = await rp(request);
console.log(await Sapient.decodeSignedJsonResponse(response, publicKey));
})();
This should result in the following (except with differing timestamps):
{ version: '1.1.x',
datetime: '2019-07-31T03:37:48-04:00',
status: 'OK',
results:
[ { contents: '{\n "repository": "paragonie\\/certainty",\n "sha256": "cb2eca3fbfa232c9e3874e3852d43b33589f27face98eef10242a853d83a437a",\n "signature": "d368533011b7e9eb09d1cc3a78faef70adcd1188aaee7a47698e0783339275b9b506a982c98dee119969c599581275f76733e0c2f96380405faed1d8678a0302",\n "time": "2019-05-15T16:26:42-04:00"\n}',
prevhash: '1RrlFkZRs6Srb9W2cNh-cGAzk5bkd9sVEes6ZShJ-ZA=',
currhash: '8wL2OsihjC2ihOfyjqs2YwvZbry11veuWucqjhz4f6Y=',
summaryhash: 'WQG3tH3CiLHg_upN0ABhKiYWOGwH3n9l4pM04bXwG54=',
created: '2019-05-15T16:26:45-04:00',
publickey: 'mPLfrUEV_qnwlsNUhbO_ILBulKysO3rPYYWqWAYCA0I=',
signature: 'W8OKNuUa8Bma0TpKWmYXxFdyvyuPaq87hvcD6VIwQgfxFowSPM5L_6q7p4FGcXDQtxP41qKHf-ANEfgxOqztAw==' } ] }
FAQs
Secure API ENgineering Toolkit
The npm package sapient receives a total of 2 weekly downloads. As such, sapient popularity was classified as not popular.
We found that sapient 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
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.