PHPackages                             thecodingmachine/csrf-header-check-middleware-universal-module - 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. thecodingmachine/csrf-header-check-middleware-universal-module

ActiveLibrary[Security](/categories/security)

thecodingmachine/csrf-header-check-middleware-universal-module
==============================================================

Cross-framework module for thecodingmachine/csrf-header-check-middleware

v1.1.0(8y ago)041MITPHPPHP &gt;=7.0

Since Jun 12Pushed 8y ago6 watchersCompare

[ Source](https://github.com/thecodingmachine/csrf-header-check-middleware-universal-module)[ Packagist](https://packagist.org/packages/thecodingmachine/csrf-header-check-middleware-universal-module)[ RSS](/packages/thecodingmachine-csrf-header-check-middleware-universal-module/feed)WikiDiscussions master Synced 6d ago

READMEChangelog (2)Dependencies (3)Versions (3)Used By (0)

[![Latest Stable Version](https://camo.githubusercontent.com/5b142e5a00efd0da347560cec3b7f418daae4be18a40c5706541355b1e3c3321/68747470733a2f2f706f7365722e707567782e6f72672f746865636f64696e676d616368696e652f637372662d6865616465722d636865636b2d6d6964646c65776172652d756e6976657273616c2d6d6f64756c652f762f737461626c65)](https://packagist.org/packages/thecodingmachine/csrf-header-check-middleware-universal-module)[![Latest Unstable Version](https://camo.githubusercontent.com/5d2cf42c8504883548ae91b07714835f4d24d635baa82b166e733bf2879d0b3b/68747470733a2f2f706f7365722e707567782e6f72672f746865636f64696e676d616368696e652f637372662d6865616465722d636865636b2d6d6964646c65776172652d756e6976657273616c2d6d6f64756c652f762f756e737461626c65)](https://packagist.org/packages/thecodingmachine/csrf-header-check-middleware-universal-module)[![License](https://camo.githubusercontent.com/8078d30682e63d9969beba58859452c86e023c672d2aada3e5d5f328fb60798a/68747470733a2f2f706f7365722e707567782e6f72672f746865636f64696e676d616368696e652f637372662d6865616465722d636865636b2d6d6964646c65776172652d756e6976657273616c2d6d6f64756c652f6c6963656e7365)](https://packagist.org/packages/thecodingmachine/csrf-header-check-middleware-universal-module)

TheCodingMachine's CSRF header checker middleware universal module
==================================================================

[](#thecodingmachines-csrf-header-checker-middleware-universal-module)

This package integrates the [TheCodingMachine's CSRF header checker middleware](https://github.com/thecodingmachine/csrf-header-check-middleware) in any [container-interop](https://github.com/container-interop/service-provider) compatible framework/container.

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

[](#installation)

```
composer require thecodingmachine/csrf-header-check-middleware-universal-module

```

Once installed, you need to register the [`TheCodingMachine\Middlewares\CsrfHeaderCheckMiddlewareServiceProvider`](src/CsrfHeaderCheckMiddlewareServiceProvider.php) into your container.

If your container supports [thecodingmachine/discovery](https://github.com/thecodingmachine/discovery) integration, you have nothing to do. Otherwise, refer to your framework or container's documentation to learn how to register *service providers*.

Introduction
------------

[](#introduction)

This middleware checks HTTP header to prevent CSRF attacks. This service provider adds the middleware at the beginning of the stack.

Provided services
-----------------

[](#provided-services)

This *service provider* provides the following services:

Service nameDescription`TheCodingMachine\Middlewares\CsrfHeaderCheckMiddlewareServiceProvider`The CSRF checker middlewareExtended services
-----------------

[](#extended-services)

This *service provider* extends those services:

NameCompulsoryDescription`MiddlewareListServiceProvider::MIDDLEWARES_QUEUE`*no*This service providers inserts the CSRF middleware in the middleware queue.

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~260 days

Total

2

Last Release

3001d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1104771?v=4)[mouf](/maintainers/mouf)[@Mouf](https://github.com/Mouf)

![](https://avatars.githubusercontent.com/u/1847918?v=4)[TheCodingMachine](/maintainers/thecodingmachine)[@thecodingmachine](https://github.com/thecodingmachine)

---

Top Contributors

[![moufmouf](https://avatars.githubusercontent.com/u/1290952?v=4)](https://github.com/moufmouf "moufmouf (4 commits)")

### Embed Badge

![Health badge](/badges/thecodingmachine-csrf-header-check-middleware-universal-module/health.svg)

```
[![Health](https://phpackages.com/badges/thecodingmachine-csrf-header-check-middleware-universal-module/health.svg)](https://phpackages.com/packages/thecodingmachine-csrf-header-check-middleware-universal-module)
```

###  Alternatives

[defuse/php-encryption

Secure PHP Encryption Library

3.9k162.4M214](/packages/defuse-php-encryption)[roave/security-advisories

Prevents installation of composer packages with known security vulnerabilities: no API, simply require it

2.9k97.3M6.4k](/packages/roave-security-advisories)[mews/purifier

Laravel 5/6/7/8/9/10 HtmlPurifier Package

2.0k16.7M113](/packages/mews-purifier)[robrichards/xmlseclibs

A PHP library for XML Security

41278.1M118](/packages/robrichards-xmlseclibs)[bjeavons/zxcvbn-php

Realistic password strength estimation PHP library based on Zxcvbn JS

86917.5M63](/packages/bjeavons-zxcvbn-php)[illuminate/encryption

The Illuminate Encryption package.

9229.7M280](/packages/illuminate-encryption)

PHPackages © 2026

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