Metadata-Version: 2.4
Name: jscope
Version: 1.0.0
Summary: Evidence-backed application security intelligence for JavaScript and web applications
Author: Muhammed Ali
License-Expression: MIT
Project-URL: Homepage, https://github.com/LIME1Star/Jscope
Project-URL: Issues, https://github.com/LIME1Star/Jscope/issues
Project-URL: Changelog, https://github.com/LIME1Star/Jscope/blob/main/CHANGELOG.md
Keywords: security,bug-bounty,pentest,javascript,static-analysis,appsec,recon
Classifier: Development Status :: 5 - Production/Stable
Classifier: Environment :: Console
Classifier: Intended Audience :: Information Technology
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Security
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tree-sitter>=0.23
Requires-Dist: tree-sitter-javascript>=0.23
Requires-Dist: tree-sitter-typescript>=0.23
Requires-Dist: requests>=2.31
Requires-Dist: beautifulsoup4>=4.12
Provides-Extra: yaml
Requires-Dist: PyYAML>=6.0; extra == "yaml"
Provides-Extra: browser
Requires-Dist: playwright>=1.40; extra == "browser"
Provides-Extra: dev
Requires-Dist: pytest>=7; extra == "dev"
Requires-Dist: PyYAML>=6.0; extra == "dev"
Requires-Dist: build; extra == "dev"
Requires-Dist: twine; extra == "dev"
Dynamic: license-file

# JScope

**Evidence-backed application security intelligence for JavaScript and web applications.**

JScope reconstructs how a web application behaves from its JavaScript and related client-side artifacts. It connects routes, components, API calls, authentication and authorization signals, roles, and data flows into an evidence-backed application map.

Its goal is not to produce the longest list of URLs or suspicious strings. It helps you understand what the code actually shows, where relationships are supported by evidence, and where further manual investigation is needed.

> **JScope findings are investigation leads, not proof of remotely exploitable vulnerabilities.** Always validate results and test only systems you own or are explicitly authorized to assess.

## Requirements

- Python 3.10 or newer
- Internet access for remote crawling and downloading
- Supported JavaScript/TypeScript parser dependencies (installed automatically with JScope)

Optional:
- `PyYAML` for YAML OpenAPI specifications
- Playwright for browser-based observation features

## Installation

### From PyPI

```bash
python -m pip install --upgrade jscope
```

Optional features:

```bash
python -m pip install "jscope[yaml]"
python -m pip install "jscope[browser]"
```

### Verify the installation

```bash
jscope --version
jscope --help
jscope doctor
```

## Quick start

### Analyze a local project

```bash
jscope analyze ./path/to/project
```

### Start an investigation against an authorized web application

```bash
jscope https://app.example.com
```

Start the interactive shell with:

```bash
jscope
```

Enter a URL or local project path to begin. The shell keeps the active investigation context so you can inspect findings, view the application graph, and generate reports without repeatedly specifying file paths.

### Crawl a site

```bash
jscope crawl https://app.example.com
```

The crawler follows ordinary same-host HTML links and discovers supported client-side assets. Defaults are limited to 25 pages and link depth 2. Adjust the limits with:

```bash
jscope crawl https://app.example.com --max-pages 100 --max-depth 4
```

External hosts are not crawled as pages. Requests are subject to scope and transport policy. Forms are not submitted, and authentication or WAF controls are not bypassed.

## Common workflow

After starting an investigation, these commands operate on the active context:

```bash
jscope status
jscope findings
jscope show 1
jscope show 1 --source
jscope graph
jscope report --format html
jscope history
jscope switch 2
```

Useful direct commands:

| Command | Purpose |
|---|---|
| `jscope analyze PATH` | Analyze local JavaScript/TypeScript project files |
| `jscope crawl URL` | Discover same-host pages and client-side assets |
| `jscope download URL` | Download JavaScript assets from a URL list |
| `jscope scan URL` | Run crawl, download, analysis, and reporting |
| `jscope graph` | Display route, component, API, and guard relationships |
| `jscope findings` | List ranked, evidence-backed findings |
| `jscope show ID` | Inspect a finding and its supporting evidence |
| `jscope investigate` | Correlate saved evidence into investigation leads |
| `jscope report` | Generate human-readable or machine-readable reports |
| `jscope status` | Show active target, scope, and evidence state |
| `jscope history` | List recent investigation contexts |
| `jscope switch N` | Restore a previous investigation context |
| `jscope doctor` | Diagnose installation and environment issues |
| `jscope plugins` | List available analyzers and their trust tier |
| `jscope benchmark` | Run the bundled analysis benchmark |

For exact flags and options, use:

```bash
jscope COMMAND --help
```

## What JScope analyzes

JScope includes analyzers for:

- Frontend routes and routing frameworks
- Authentication and client-side authorization patterns
- Components, guards, and declared roles
- API endpoints and route-to-API attribution
- Storage and token-handling patterns
- GraphQL operations and schemas
- OpenAPI specifications
- Service workers, source maps, and HTML security configuration
- WebAssembly references and modules
- Potentially exposed secrets
- Interprocedural data-flow paths and project-level module relationships

The application graph and investigation output preserve evidence provenance. Unresolved imports, dynamic module names, ambiguous bindings, and unsupported conventions remain unresolved instead of being silently guessed.

## Scope and safety controls

JScope is designed to make network activity explicit.

- Remote commands are constrained by the target and assessment scope.
- Loopback and private-network destinations are refused by default. Use `--allow-private` only for a controlled local environment you are authorized to test.
- An alternate `--base-url` requires explicit host authorization with `--allow-host`.
- Runtime confirmation and verification are opt-in and require `--authorize-active-tests` in non-interactive use.
- Browser observation requires explicit host authorization.
- Non-interactive remote `go` runs require `-y`.
- Crawling uses GET requests; it does not submit forms or attempt to bypass authentication or WAF controls.

Review the command's `--help` output before enabling any runtime operation. Authorization to inspect client-side code does not automatically authorize active requests against the server.

## Reports and automation

JScope can render saved analysis results in human-readable, JSON, Markdown, HTML, and SARIF formats where supported by the selected command.

Some commands support `--json` for scripting. Check command-specific help for exact output and exit-code behavior.

## Limitations

- Static analysis cannot establish that a server-side vulnerability is exploitable.
- A missing client-side guard does not prove that server-side authorization is missing.
- Route-to-API attribution can be less precise for imported components than for components defined in the route file.
- Dynamic imports, custom loaders, unsupported framework conventions, and ambiguous symbol bindings can limit cross-file resolution.
- Runtime confirmation is narrow and indicates that a route responds; it does not prove vulnerability.
- Benchmark results use a synthetic fixture corpus and should be treated as regression signals, not estimates of real-world precision or recall.
- Plugin code is executable Python. File-based community plugins may run in a worker process, but installed entry-point plugins and explicitly trusted plugins can run in-process. This is not a hardened operating-system sandbox.

## Version

This distribution is **JScope 1.0.0**. The package version is intentionally unchanged.

## License

MIT. See [LICENSE](LICENSE).
