![Malicious npm Package Typosquats react-login-page to Deploy Keylogger](https://cdn.sanity.io/images/cgdhsj6q/production/007b21d9cf9e03ae0bb3f577d1bd59b9d715645a-1024x1024.webp?w=400&fit=max&auto=format)
Research
Security News
Malicious npm Package Typosquats react-login-page to Deploy Keylogger
Socket researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
caller-id
Advanced tools
Readme
A utility for getting information on the caller of a function in node.js
caller-id
as a dependency to your project’s package.json
npm install
getData
getData()
can be used to get raw data about a function's caller
var callerId = require('caller-id');
// 1. Function calling another function
function foo() {
bar();
}
function bar() {
var caller = callerId.getData();
/*
caller = {
typeName: 'Object',
functionName: 'foo',
filePath: '/path/of/this/file.js',
lineNumber: 5,
topLevelFlag: true,
nativeFlag: false,
evalFlag: false
}
*/
}
// 2. Method in a class calling a function
function Lorem() {}
Lorem.prototype.ipsum = function() {
baz();
}
function baz() {
var caller = callerId.getData();
/*
caller = {
typeName: 'Lorem',
functionName: 'Lorem.ipsum',
methodName: 'ipsum',
filePath: '/path/of/this/file.js',
lineNumber: 25,
topLevelFlag: false,
nativeFlag: false,
evalFlag: false
}
*/
}
// 3. Function in an eval calling another function
function func() {
var caller = callerId.getData();
/*
caller = {
typeName: 'Object',
functionName: 'evil',
lineNumber: 2,
topLevelFlag: true,
nativeFlag: false,
evalFlag: true,
evalOrigin: 'eval at <anonymous> (/path/of/this/file.js:58:7)'
}
*/
}
eval('(function evil() {' + '\\n' +
'func();' + '\\n' +
'})();');
getString
getString()
returns a brief string representing a function's caller
var callerId = require('caller-id');
function myFunction() {
var callerString = callerId.getString();
}
Using the same examples as above, getString()
returns the following:
getDetailedString
getDetailedString()
returns a more detailed string representing a function's caller
var callerId = require('caller-id');
function myFunction() {
var detailedCallerString = callerId.getDetailedString();
}
Using the same examples as above, getDetailedString()
returns the following:
FAQs
Unknown package
The npm package caller-id receives a total of 22,330 weekly downloads. As such, caller-id popularity was classified as popular.
We found that caller-id 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 researchers unpack a typosquatting package with malicious code that logs keystrokes and exfiltrates sensitive data to a remote server.
Security News
The JavaScript community has launched the e18e initiative to improve ecosystem performance by cleaning up dependency trees, speeding up critical parts of the ecosystem, and documenting lighter alternatives to established tools.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.