Skip to content

Conversation

@acezxn
Copy link

@acezxn acezxn commented Sep 5, 2025

Added detection of Null Pointer Dereference (NPD) support for Javascript.

  • Basic detection of the deferencing of variables that are null/undefined
  • Deleted property usage detection
  • Inter scope data flow analysis for supporting nested functions / global variables

 variables and removed detection of potentially nullable builtin functions
- Non local variable assignments are now considered as part of the propagation details.
- Non local variable assignments are now considered as a side effect and all caller functions that invoked the non-local-changing function would be added to the worklist for dataflow anaysis.
- Adjusted potential buggy path detection to include non local variable assignments.

These changes enables Repoaudit to detect NPD styled bugs in Javascript that involves non local variables (see benchmark/Javascript/toy/NPD/case06.js for example).
@chengpeng-wang chengpeng-wang changed the base branch from main to js-audit November 14, 2025 04:48
@chengpeng-wang
Copy link
Contributor

@acezxn Thank you for your contribution. Please refactor the code and add your latest version before the merge.

@acezxn acezxn marked this pull request as ready for review November 15, 2025 01:16
Copy link
Contributor

@chengpeng-wang chengpeng-wang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could merge it to js-audit branch first and then continue to pollsh it.

@chengpeng-wang
Copy link
Contributor

@acezxn Please execute mypy src and black src to fix the check errors first.

@chengpeng-wang chengpeng-wang merged commit f9c7bf4 into PurCL:js-audit Nov 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants