Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

obfuscation-detector

Package Overview
Dependencies
Maintainers
2
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

obfuscation-detector - npm Package Compare versions

Comparing version 1.1.3 to 1.1.4

4

package.json
{
"name": "obfuscation-detector",
"version": "1.1.3",
"version": "1.1.4",
"description": "Javascript obfuscation detector",

@@ -35,4 +35,4 @@ "main": "src/index.js",

"dependencies": {
"flast": "^1.4.0"
"flast": "^1.5.0"
}
}

@@ -5,10 +5,10 @@ const obfuscationName = 'caesar_plus';

* @param {ASTNode} targetNode
* @param {ASTScope} targetScope
* @param {ASTNode} targetScopeBlock
* @return {boolean} true if the target node is found in the targetScope; false otherwise.
*/
function isNodeInScope(targetNode, targetScope) {
if (!targetScope) return true;
function isNodeInScope(targetNode, targetScopeBlock) {
if (!targetScopeBlock) return true;
let currentScope = targetNode.scope;
while (currentScope.scopeId) {
if (targetScope === currentScope) return true;
while (currentScope) {
if (targetScopeBlock === currentScope.block) return true;
currentScope = currentScope.upper;

@@ -39,3 +39,3 @@ }

for (const c of candidates) {
const funcTree = flatTree.filter(n => isNodeInScope(n, c.scope));
const funcTree = flatTree.filter(n => isNodeInScope(n, c.isScopeBlock ? c : c.scope.block));
// Verify all variables are 3 letters long

@@ -42,0 +42,0 @@ if (!funcTree.some(n => n.type === 'VariableDeclarator' &&

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc