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 1mo 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

38

—

LowBetter than 84% of packages

Maintenance36

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

617d 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.8k18.5M1.6k](/packages/cakephp-cakephp)[thecodingmachine/graphqlite

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

5723.1M30](/packages/thecodingmachine-graphqlite)[neos/flow

Flow Application Framework

862.0M449](/packages/neos-flow)[neos/flow-development-collection

Flow packages in a joined repository for pull requests.

144179.3k3](/packages/neos-flow-development-collection)[windwalker/framework

The next generation PHP framework.

25639.1k1](/packages/windwalker-framework)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28483.0k2](/packages/mezzio-mezzio-authentication-oauth2)

PHPackages © 2026

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