npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

circle-ir

v3.8.0

Published

High-performance Static Application Security Testing (SAST) library for detecting security vulnerabilities through taint analysis

Readme

circle-ir

A high-performance Static Application Security Testing (SAST) library for detecting security vulnerabilities through taint analysis. Works in Node.js, browsers, and Cloudflare Workers.

Features

  • Taint Analysis: Track data flow from sources (user input) to sinks (dangerous operations)
  • Multi-language Support: Java, JavaScript/TypeScript, Python, Rust
  • High Accuracy: 100% on OWASP Benchmark, 100% on Juliet Test Suite, 97.7% TPR on SecuriBench Micro
  • Universal: Works in Node.js, browsers, and Cloudflare Workers
  • Zero External Dependencies: Core analysis runs without network calls or external services
  • Browser Compatible: Tree-sitter WASM for universal parsing
  • Configuration-Driven: YAML/JSON patterns for sources, sinks, and sanitizers

Related Packages

Installation

npm install circle-ir

Quick Start

Node.js

import { initAnalyzer, analyze } from 'circle-ir';

// Initialize the analyzer
await initAnalyzer();

// Analyze Java code
const result = await analyze(code, 'MyClass.java', 'java');

// Check for vulnerabilities
for (const flow of result.taint.flows || []) {
  console.log(`Found ${flow.sink_type} vulnerability`);
  console.log(`  Source: line ${flow.source_line}`);
  console.log(`  Sink: line ${flow.sink_line}`);
}

Browser

<script type="module">
import { initAnalyzer, analyze } from './dist/browser/circle-ir.js';

await initAnalyzer({
  wasmPath: './wasm/web-tree-sitter.wasm',
  languagePaths: {
    java: './wasm/tree-sitter-java.wasm'
  }
});

const result = await analyze(code, 'Test.java', 'java');
console.log(result);
</script>

API Reference

initAnalyzer(options?)

Initialize the analyzer. Must be called before analyze().

interface AnalyzerOptions {
  wasmPath?: string;           // Path to web-tree-sitter.wasm
  languagePaths?: {            // Paths to language WASM files
    java?: string;
    javascript?: string;
    python?: string;
    rust?: string;
  };
  taintConfig?: TaintConfig;   // Custom taint configuration
}

analyze(code, filePath, language, options?)

Analyze source code and return Circle-IR output.

const result = await analyze(code, 'File.java', 'java');

// Result contains:
result.meta       // File metadata
result.types      // Classes, methods, fields
result.calls      // Method invocations
result.cfg        // Control flow graph
result.dfg        // Data flow graph
result.taint      // Taint sources, sinks, flows
result.imports    // Import statements
result.exports    // Exported symbols

analyzeForAPI(code, filePath, language, options?)

Simplified API response format suitable for REST APIs.

const response = await analyzeForAPI(code, 'File.java', 'java');

// Response format:
{
  success: true,
  analysis: {
    sources: [...],
    sinks: [...],
    vulnerabilities: [...]
  },
  meta: {
    parseTimeMs: 15,
    analysisTimeMs: 42,
    totalTimeMs: 57
  }
}

Supported Languages

| Language | Parser | Frameworks | |----------|--------|------------| | Java | tree-sitter-java | Spring, JAX-RS, Servlet API | | JavaScript/TypeScript | tree-sitter-javascript | Express, Fastify, Node.js | | Python | tree-sitter-python | Flask, Django, FastAPI | | Rust | tree-sitter-rust | Actix-web, Rocket, Axum |

Multi-Language Examples

// Analyze JavaScript
const jsResult = await analyze(jsCode, 'server.js', 'javascript');

// Analyze Python
const pyResult = await analyze(pyCode, 'app.py', 'python');

// Analyze Rust
const rsResult = await analyze(rsCode, 'main.rs', 'rust');

Detected Vulnerabilities

| Type | CWE | Description | |------|-----|-------------| | SQL Injection | CWE-89 | User input in SQL queries | | Command Injection | CWE-78 | User input in system commands | | XSS | CWE-79 | User input in HTML output | | Path Traversal | CWE-22 | User input in file paths | | LDAP Injection | CWE-90 | User input in LDAP queries | | XPath Injection | CWE-643 | User input in XPath queries | | Deserialization | CWE-502 | Untrusted deserialization | | SSRF | CWE-918 | Server-side request forgery | | Code Injection | CWE-94 | Dynamic code execution | | XXE | CWE-611 | XML external entity injection |

Configuration

Custom taint sources, sinks, and sanitizers can be configured via YAML:

# configs/sources/custom.yaml
sources:
  - method: getUserInput
    class: CustomInputHandler
    type: http_param
    severity: high
    tainted_args: [return]

Key Analysis Features

  • Constant Propagation: Eliminates false positives by tracking variable values and detecting dead code
  • DFG-Based Verification: Uses data flow graphs to verify end-to-end taint flows
  • Inter-Procedural Analysis: Tracks taint across method boundaries
  • Sanitizer Recognition: Detects PreparedStatement, ESAPI, escapeHtml, and other sanitizers
  • Collection Tracking: Precise taint tracking through List/Map operations with index shifting

Benchmark Results

| Benchmark | Score | Details | |-----------|-------|---------| | OWASP Benchmark | +100% | TPR 100%, FPR 0% (1415 test cases) | | Juliet Test Suite | +100% | 156/156 test cases, 9 CWEs | | SecuriBench Micro | 97.7% TPR | 105/108 vulns detected, 6.7% FPR | | CWE-Bench-Java | 81.7% (with LLM) | 98/120 projects (vs CodeQL 22.5%, IRIS+GPT-4 45.8%) |

Documentation

License

ISC