Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
A package that allows the caller to extrace SWIFT codes published by the http://bank.codes service
Add to your project from the NPM repository:
npm install bank-codes --save
and grab an instance:
// using ES6 modules
import bc from 'bank-codes';
// using CommonJS modules
const bc = require('bank-codes');
The methods in this package store the data retrieved into a cache.json
file. This package contains such a file and most clients will simply want to use it directly, rather than scanning the site for the data. The file may be included like this:
const bc = require('bank-codes/cache.json')
The following methods are available in the package:
Returns an object keyed by country names and values a path within the site see a list of banks
{
"United States": "/swift-code/united-states/"
}
Retrieves the list of banks for the given country. The return value is similar that below:
[
{
"Name": "1ST PMF BANCORP",
"City": "LOS ANGELES",
"Branch": "",
"SWIFT": "PMFAUS66HKG"
}
]
The methods return promises so their return values need to be waited for
// as a promise
bc.banks('United States').then(console.log);
// async/await
(async () => {
console.log(await bc.banks('United States'));
})()
The cache file produced when calling package methods may become stale across time and can be regenerated by running:
npm run cache
Additionally, country lists of banks can be generated on the command line by adding the country names to the command (titlecased) e.g.
npm run cache Mexico Sweden
will output progress information to stderr and the output to stdout so it can be captured:
npm run cache Mexico > Mexico.json
If you add functionality, make sure tests pass:
npm test
and when publishing, bump up the version like this:
npm version <patch|minor|major>
ISC
For support post an issue on Github or reach out to me directly @ekkis on Telegram
FAQs
An extraction facility for https://bank.codes
We found that bank-codes 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.