Skip to main content

A simple C vuln cli scanner

Project description

CScan – C Source Code Vulnerability Scanner

CScan is a command-line tool for analyzing C source code for memory safety and security vulnerabilities, including buffer overflows, memory leaks, use-after-free, null pointer dereferences, format string vulnerabilities, and array bounds violations.

Features

  • Scan single C files or entire directories recursively
  • Detects high-risk vulnerabilities with confidence scoring
  • Generates detailed JSON reports
  • CLI flags for custom confidence thresholds and output files
  • Supports verbose output for debugging

Installation

Install via PyPI (or TestPyPI for testing):

pip install cscan

Usage

Scan a single file:

cscan scan vulnerable.c

Scan a directory recursively with custom confidence threshold:

cscan scan src/ --recursive --confidence 0.8 --output report.json

Enable verbose output:

cscan scan src/ -v

Output

  • Prints vulnerabilities to the terminal, grouped by severity
  • Generates JSON report (if --output specified) with:
    • Metadata (scan time, scanner version, files analyzed)
    • Findings (detailed per-vulnerability information)
    • Summary statistics by severity, type, and file

Example

CRITICAL SEVERITY (2 findings):

[Buffer Overflow] example.c:42 Function: copy_input Confidence: 100% Description: Unsafe function 'strcpy()' without bounds checking Recommendation: Use strncpy() with proper size limits CWE: CWE-120

[Use After Free] example.c:78 Function: cleanup Confidence: 85% Description: Variable 'ptr' used after being freed Recommendation: Set pointer to NULL after free() CWE: CWE-416

License

MIT License © 2025 Evan Kirtz

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cscan-0.1.1.tar.gz (10.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cscan-0.1.1-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file cscan-0.1.1.tar.gz.

File metadata

  • Download URL: cscan-0.1.1.tar.gz
  • Upload date:
  • Size: 10.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for cscan-0.1.1.tar.gz
Algorithm Hash digest
SHA256 d4b156d7d1062c2495c5eb50eb46d98738aa6480f2d18479e99a31db328dbdd3
MD5 f128be835b2de61a40aef284d5b942ee
BLAKE2b-256 99b0d1c1c827c1cea4b81928794501bad9f4763c70133b4c16dccc160f47bb00

See more details on using hashes here.

File details

Details for the file cscan-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: cscan-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for cscan-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d5ec5933a2bc2ff6680432c224eebf98a3a6c14f9cb163ed344f4c27e4c5e8a9
MD5 5abf2057e8664576ef3430d08bbdb343
BLAKE2b-256 3ab8af2c182df466c5683da469ba0f11667f4dc94989caa6113caa37ab338e28

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page