Security / PHP + Rust + Go

Every requestpasses a shield

31 stateless detectors and 4 identity checks block on hit, with logs and an IP blacklist following up.

Shieldy, Security PHP mascot, the security project pet

31 detectors guard every request

security-php scans GET, POST, Cookie and file uploads with regex patterns and structural analysis, covering injection, SSRF, XXE, deserialization, JWT and sensitive data leaks.

The identity layer also checks session hijacking, unusual logins, data tampering and brute-force lockout. A hit is blocked with the detector's status code: browsers get a block page, APIs get plain text.

  • 31 stateless detectors
  • 4 identity checks
  • File / Redis / Cache
31Attack detectors
4Identity checks
0External dependencies
Shieldy, Security PHP mascot Smile expression

Shieldy

A smiling blue shield holding a magnifying glass, the guard that inspects and blocks attacks on every request.

Block it, and see it.

From input scanning to identity checks

Detect, log and block through one pipeline.

31 detectors

Cover injection, SSRF, XXE, deserialization, JWT, uploads and data leaks.

Grouped chain

25 detectors extend one regex base class and run in priority order.

Encoding normalization

Decode URL, double, fullwidth and HTML entity encoding, then scan again.

Four identity checks

Session hijacking, unusual login, data tampering and brute-force lockout.

Pluggable storage

File, Redis and Cache backends shared by the blacklist and identity checks.

Block page

Browsers receive an HTML page with Shieldy, while API clients get plain text.

Same capability, Rust and Go versions

Rust and Go bring the same detection capability.

Rust v4.0.0 Rust 1.88 / crate

security-rust

Attack detection for Rust

32 detectors cover injection, protocol, data and file attacks, plus sessions, throttling, scoring.

  • 32 detectors
  • Sessions and throttling
  • Zero framework deps
View Rust repository
Go v1.0.29 Go 1.24 / stdlib

security-go

Attack detection for Go

36 detectors across 6 attack categories, 3 storage backends, for any Go HTTP framework.

  • 36 detectors
  • 6 attack categories
  • 3 storage backends
View Go repository

How the security layers grew

Every version comes from real commit history.

v1.5.0

Yii2 and Yii3 adapters

Added a Yii2 request-event bootstrap and a Yii3 PSR-15 integration path.

v1.4.0

Block page and faster chain

Added the Shieldy browser block page; regex prefiltering cut a typical form scan from 21.7ms to 6.0ms.

v1.3.3

Masking and upload fixes

Fixed missed detections from same-name parameters masked across sources and restored broken upload content scanning.

v1.3.0

Identity layer landed

Added session hijacking, unusual login, data tampering and login lockout, with normalization and response headers.

Changelog

Recent releases; full list on GitHub Releases.

Latest v1.5.0 All versions
v1.5.02026-09-29

Added Yii2 and Yii3 adapters and completed native PHP integration docs.

v1.4.22026-09-25

Added the required PHPSESSID change and configuration notes for native PHP.

v1.4.12026-09-25

Synced native PHP integration, hardening behavior and configuration docs.

v1.4.02026-09-25

Added the HTML block page and regex prefiltering to speed up the detection chain.

v1.3.32026-09-15

Fixed missed detections from same-name masking and broken file upload scanning.

v1.3.22026-09-15

Completed framework-free support docs and design notes.

Install and use

Install it, then scan one request.

PHP >= 8.0 / zero dependenciesFull README
Install
composer require erikwang2013/security-php
Minimal example
$threats = security_scan_current_request();

if (!empty($threats)) {
    foreach ($threats as $threat) {
        echo "检测到攻击: {$threat->type} - {$threat->detail}\n";
    }
}

security_guard();

Twelve faces of Shieldy

Hover and the mood changes.

Search this site

Try “upload”, “migration” or “JWT”.