PHPackages                             dmt-software/anti-xss-middleware - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. dmt-software/anti-xss-middleware

ActiveLibrary

dmt-software/anti-xss-middleware
================================

PSR-15 middleware to help prevent xss attacks

2.1.0(1y ago)112.4k—0%1MITPHPPHP ^8.1

Since Apr 7Pushed 1y ago2 watchersCompare

[ Source](https://github.com/dmt-software/anti-xss-middleware)[ Packagist](https://packagist.org/packages/dmt-software/anti-xss-middleware)[ RSS](/packages/dmt-software-anti-xss-middleware/feed)WikiDiscussions main Synced today

READMEChangelog (5)Dependencies (6)Versions (8)Used By (0)

Anti XSS Middleware
===================

[](#anti-xss-middleware)

This middleware implements the PSR-15 MiddlewareInterface and can be helpful to prevent XSS attacks.

Installation
------------

[](#installation)

```
composer require dmt-software/anti-xss-middleware
```

Usage
-----

[](#usage)

```
use DMT\Http\AntiXss\Middleware\AntiXssMiddleware;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Server\RequestHandlerInterface;

/** @var ResponseFactoryInterface $responseFactory */
$antiXssMiddleware = new AntiXssMiddleware($responseFactory);

/** @var ServerRequestInterface $request */
/** @var RequestHandlerInterface $handler */
$response = $antiXssMiddleware->process($request, $handler);

if ($response->getStatusCode() === 400) {
    // cross site scripting detected
}
```

###  Health Score

37

—

LowBetter than 84% of packages

Maintenance37

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 77.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~146 days

Recently: every ~139 days

Total

7

Last Release

569d ago

Major Versions

1.0.1 → 2.0.02023-02-22

PHP version history (2 changes)2.0.x-devPHP ^8.1

1.0.x-devPHP &gt;=7.4

### Community

Maintainers

![](https://www.gravatar.com/avatar/ec6b7fbb4d231b5c2c76348cf3a13ec5e82c64a1826142f6ec0db1cf15db2873?d=identicon)[proggeler](/maintainers/proggeler)

![](https://www.gravatar.com/avatar/ea1df8d4eb476756f31e2c698e8b2c161c8be1b8482091f930abbddfd8d2fc52?d=identicon)[lingonl](/maintainers/lingonl)

---

Top Contributors

[![proggeler](https://avatars.githubusercontent.com/u/18281353?v=4)](https://github.com/proggeler "proggeler (7 commits)")[![lingonl](https://avatars.githubusercontent.com/u/3777294?v=4)](https://github.com/lingonl "lingonl (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/dmt-software-anti-xss-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/dmt-software-anti-xss-middleware/health.svg)](https://phpackages.com/packages/dmt-software-anti-xss-middleware)
```

###  Alternatives

[mezzio/mezzio

PSR-15 Middleware Microframework

3883.5M88](/packages/mezzio-mezzio)[neos/flow

Flow Application Framework

862.0M395](/packages/neos-flow)[yiisoft/csrf

Yii CSRF Protection Library

26245.0k7](/packages/yiisoft-csrf)[yiisoft/rate-limiter

Yii Rate Limiter Middleware

2963.3k](/packages/yiisoft-rate-limiter)[phps-cans/psr7-middleware-graphql

This package contains a http-interop middleware implementation to handle graphql request

1528.7k](/packages/phps-cans-psr7-middleware-graphql)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
