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. [Security](/categories/security)
4. /
5. dmt-software/anti-xss-middleware

ActiveLibrary[Security](/categories/security)

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

PSR-15 middleware to help prevent xss attacks

2.1.0(1y ago)113.0k↓51.9%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 3w ago

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 81% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity27

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

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

663d 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

[cakephp/cakephp

The CakePHP framework

8.8k19.1M1.7k](/packages/cakephp-cakephp)[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

7.9k1.1B3.7k](/packages/guzzlehttp-psr7)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[typo3/cms

TYPO3 CMS is a free open source Content Management Framework initially created by Kasper Skaarhoj and licensed under GNU/GPL.

1.2k1.9M122](/packages/typo3-cms)[thecodingmachine/graphqlite

Write your GraphQL queries in simple to write controllers (using webonyx/graphql-php).

5733.2M40](/packages/thecodingmachine-graphqlite)[typo3/cms-core

TYPO3 CMS Core

3312.9M4.8k](/packages/typo3-cms-core)

PHPackages © 2026

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