Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
805a0f0
Added javascript NPD support
acezxn Aug 28, 2025
024a2a7
Modified build.py to build javascript tree sitter and added javascrip…
acezxn Aug 28, 2025
4ff5057
Added delete operator and call expression as source and sink in javas…
acezxn Aug 29, 2025
062cd1e
Update buggy path computation to exclude sinks of already defined fun…
acezxn Sep 4, 2025
6d6a83e
Improved prompt and removed code duplicates in path validator input
acezxn Sep 5, 2025
9b2d6fb
Added known javascript builtin that could return null for NPD source …
acezxn Sep 5, 2025
a8a85d1
Updated microlight.js submodule
acezxn Sep 5, 2025
3886973
Added global variable extraction for javascript
acezxn Sep 7, 2025
b8f5045
Added javascript global variable NPD analysis
acezxn Sep 21, 2025
b00c513
Briefly documented DFBScanAgent and slightly improved prompt for intr…
acezxn Sep 24, 2025
327a44f
Added delete oparator based global variable NPD detection
acezxn Sep 29, 2025
4daa3ab
Deleted javascript UAF detector
acezxn Sep 29, 2025
4585345
Briefly refactored Javascript NPD detector
acezxn Sep 30, 2025
06e44ae
Fixed segmentation fault caused by accessing nonexistent child
acezxn Oct 5, 2025
3c96b96
Implemented extraction of relevant non-local
acezxn Oct 20, 2025
029b254
Extended __process_src_value for non local variable analysis
acezxn Oct 25, 2025
1173bb0
Fixed bugs in non local extraction
acezxn Oct 25, 2025
660f320
Added back original global variable analysis and removed language dep…
acezxn Nov 9, 2025
52743e7
Specified nullish value extraction rule for Javascript
acezxn Nov 11, 2025
d2b942f
Merge branch 'js-audit' into js-audit-1
acezxn Nov 15, 2025
9ecf357
Added missing abstract function implementations to TS analyzers and N…
acezxn Nov 15, 2025
aa90716
Added nullish arguments as source type
acezxn Nov 18, 2025
9ed352f
Fixed mypy errors
acezxn Nov 21, 2025
06384d4
Ran black formatter
acezxn Nov 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,4 @@ cython_debug/
#.idea/

testcases/**
.vscode
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,15 @@
[submodule "benchmark/Go/sally"]
path = benchmark/Go/sally
url = https://github.com/uber-go/sally.git
[submodule "benchmark/Javascript/microlight"]
path = benchmark/Javascript/microlight
url = https://github.com/asvd/microlight.git
[submodule "benchmark/Javascript/mocha"]
path = benchmark/Javascript/mocha
url = https://github.com/mochajs/mocha.git
[submodule "squish"]
path = squish
url = https://github.com/shgysk8zer0/squish.git
[submodule "benchmark/Javascript/squish"]
path = benchmark/Javascript/squish
url = https://github.com/shgysk8zer0/squish.git
15 changes: 15 additions & 0 deletions benchmark/Javascript/toy/NPD/case01.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var myname = "daniel";
myname = null;

function test2_process(data) {
let current = myname;
let value = data[0];
console.log(current.length)
return value;
}


function test2_caller() {
let data = null;
return test2_process(data)
}
14 changes: 14 additions & 0 deletions benchmark/Javascript/toy/NPD/case02.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
function func_generator(value) {
let fn = null;
if (value % 3 == 0) {
fn = console.log;
} else if (value % 3 == 1) {
fn = console.error;
}
return fn;
}

const print = () => {
func_generator(8)("Hello world!");
console.log("Done");
}
11 changes: 11 additions & 0 deletions benchmark/Javascript/toy/NPD/case03.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function getLength2(value) {
if (!value) {
return 0;
}
return value.length;
}

const print2 = () => {
let a = getLength2(null);
console.log();
}
17 changes: 17 additions & 0 deletions benchmark/Javascript/toy/NPD/case04.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
function hello3() {
let output = [];

for (let i = 0; i < 5; i++) {
output.push(null);
}
return output;
}

function hello4() {
let output = hello3();
for (let i = 0; i < 4; i++) {
output[i] = i.toString();
}
return output[4] ? output[4].length : 0;
}

6 changes: 6 additions & 0 deletions benchmark/Javascript/toy/NPD/case05.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
var a = console.error;
delete a.error;
const exec = function () {
a.error();
}
exec()
25 changes: 25 additions & 0 deletions benchmark/Javascript/toy/NPD/case06.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
const obj = {
greet() {
let obj = 1;
console.log("hello");
}
};


const a = obj;

function call(items) {
a = items;
}

const exec = function () {
var b = null;
let c = 1;
call(b);

for (let i = 0; i < 5; i++) {
a.greet();
}
}

exec();
7 changes: 7 additions & 0 deletions lib/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,16 @@
os.system(
f'git clone https://github.com/tree-sitter/tree-sitter-python.git {cwd / "vendor/tree-sitter-python"}'
)

# Checkout to specific commit for language version 14 compatibility
os.system(
f'cd {cwd / "vendor/tree-sitter-python"} && git checkout 710796b8b877a970297106e5bbc8e2afa47f86ec'
)

if not (cwd / "vendor/tree-sitter-javascript/grammar.js").exists():
os.system(
f'git clone https://github.com/tree-sitter/tree-sitter-javascript.git {cwd / "vendor/tree-sitter-javascript"}'
)

if not (cwd / "vendor/tree-sitter-go/grammar.js").exists():
os.system(
Expand All @@ -61,6 +67,7 @@
str(cwd / "vendor/tree-sitter-cpp"),
str(cwd / "vendor/tree-sitter-java"),
str(cwd / "vendor/tree-sitter-python"),
str(cwd / "vendor/tree-sitter-javascript"),
str(cwd / "vendor/tree-sitter-go"),
],
)
19 changes: 0 additions & 19 deletions requirements.txt

This file was deleted.

Loading