Skip to content

Add fuzz testing suite and fix RC4 empty-key crash#2

Merged
itamarga merged 10 commits intodevelopfrom
feat/fuzz-testing
Mar 10, 2026
Merged

Add fuzz testing suite and fix RC4 empty-key crash#2
itamarga merged 10 commits intodevelopfrom
feat/fuzz-testing

Conversation

@itamarga
Copy link
Copy Markdown
Collaborator

@itamarga itamarga commented Mar 10, 2026

Summary

  • Add 8 fuzz targets (atheris/libFuzzer compatible) covering the full deobfuscation pipeline, parser, generator, all 16 transforms, expression simplifier, string decoders, scope analysis, and AST traversal
  • Fix ZeroDivisionError in Rc4StringDecoder when called with empty string key (key[i % len(key)] at string_decoders.py:130)
  • Add GitHub Actions fuzz workflow on develop branch using standalone fuzzer (no clang/atheris needed in CI)
  • Add GitHub Actions PyPI publish workflow triggered on GitHub Release

Test plan

  • All 8 fuzz targets run clean (0 crashes across ~25M atheris runs locally)
  • All 1370 existing tests pass
  • RC4 empty-key bug confirmed fixed by fuzz suite
  • Verify fuzz CI workflow completes on this PR
  • Add PYPI_TOKEN secret to repo for publish workflow

🤖 Generated with Claude Code

itamarga and others added 10 commits March 10, 2026 16:27
Add 8 atheris/libFuzzer fuzz targets covering the full deobfuscation
pipeline, parser, generator, all 16 transforms, expression simplifier,
string decoders, scope analysis, and AST traversal. Includes OSS-Fuzz
build script, local runner, seed corpus from regression samples, and
GitHub Actions workflow triggered on develop branch.

Fix ZeroDivisionError in Rc4StringDecoder when called with an empty
string key — `key[i % len(key)]` divided by zero. The existing guard
only checked `key is None`, not empty string.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove clang and atheris installation from the fuzz CI workflow — the
standalone random fuzzer needs no extra dependencies and is sufficient
for CI smoke testing. Atheris with libFuzzer is for local deep fuzzing.

Add publish.yml workflow that builds and publishes to PyPI on GitHub
Release, using pypa/gh-action-pypi-publish with a PYPI_TOKEN secret.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Single source of truth for version — no need to bump both
pyproject.toml and __init__.py.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Add authors, URLs, classifiers, keywords to pyproject.toml
- Include LICENSE, README, NOTICE, THIRD_PARTY_LICENSES in sdist
- Remove redundant setup.py (mypyc compilation, conflicts with pyproject.toml)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
esprima2 is a pip dependency, not bundled code. Only derivative works
(obfuscator-io-deobfuscator, javascript-deobfuscator) need attribution.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Use absolute URL for logo (renders on PyPI, not just GitHub)
- Replace requirements.txt install with pip install pyjsclear
- Add development setup with git clone
- Remove esprima2 from license attribution (runtime dependency, not bundled)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add setuptools packages.find with include = ["pyjsclear*"] to prevent
tests/ from being bundled in the wheel.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@itamarga itamarga merged commit 1c8d52d into develop Mar 10, 2026
8 checks passed
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.

1 participant