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.0.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.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: cscan-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 8ef63d0fb0639eea517f2abba89e2f8545700039732261aace146e358f878f14
MD5 ab36f7bf07c8fa6842d2d67bc18831b4
BLAKE2b-256 35420bcd76a4554bf4cbe152f69468789d10187e6f0099d6c3d17e9225ab3920

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cscan-0.1.0-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.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0f8acc034284321f776301b30a6f3b22807192bdb5f47ed9585d67f917bc9929
MD5 c566433776fd70caa42a7b8455a6d2ac
BLAKE2b-256 bf6a4cb933237ed7c1791c874f4d8b852a1f0bc014f19bd43e68d01fac1de183

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