Skip to content

Implements zero-allocation XSS detection#6

Merged
JVBotelho merged 5 commits intodevelopfrom
feature/xss-engine
Feb 9, 2026
Merged

Implements zero-allocation XSS detection#6
JVBotelho merged 5 commits intodevelopfrom
feature/xss-engine

Conversation

@JVBotelho
Copy link
Owner

Implements a zero-allocation XSS detection engine using source generators and SIMD instructions.
This enhances security for high-scale .NET services by minimizing GC pressure and latency.

Adds:

  • An XSS detection engine leveraging SearchValues for SIMD acceleration.
  • Roslyn source generators to create static Validate_MethodName() functions, eliminating reflection.
  • Integration tests covering OWASP XSS cheat sheet vectors.
  • Documentation in ADR/005-xss-engine.md detailing design decisions and performance benchmarks.
  • New CONTRIBUTING.md file with guidelines for contributing to the project.
  • New CHEATSHEET.md with essential commands for development.
  • Updates to build workflows and configurations for NuGet packaging.

Added contributing guidelines for RASP.Net project, including rules for performance, documentation, and pull request processes.
Clarified memory management pattern for variable-sized buffers.
Create CONTRIBUTING.md with project guidelines
- Replaced reflection with Source Generators (10x faster)
- Added SIMD-accelerated pattern matching (SearchValues)
- Implemented multi-pass decoding with budget control
- Documented known limitations in test suite

Benchmarks:
- Clean scan: 1,120ns → 108.9ns (10.3x improvement)
- Attack block: 4,260ns → 4,090ns (1.04x improvement)
- Hot path allocations: 136B → 136B (unchanged)

Red Team Validation: 100% block rate
Breaking Changes: None
Security Impact: Enhanced XSS detection
@JVBotelho JVBotelho added documentation Improvements or additions to documentation enhancement New feature or request performance labels Feb 9, 2026
@JVBotelho JVBotelho merged commit 3e3937f into develop Feb 9, 2026
4 checks passed
@JVBotelho JVBotelho deleted the feature/xss-engine branch February 9, 2026 22:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant