PHPackages                             pavlakis/csp-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. pavlakis/csp-middleware

ActiveLibrary[Security](/categories/security)

pavlakis/csp-middleware
=======================

Add Content-Security-Policy headers for PSR-7 requests. Uses the csp-builder library paragonie/csp-builder.

1.0(3y ago)3519MITPHP ^8.1

Since Apr 28Compare

[ Source](https://github.com/pavlakis/csp-middleware)[ Packagist](https://packagist.org/packages/pavlakis/csp-middleware)[ Docs](http://github.com/pavlakis/csp-middleware)[ RSS](/packages/pavlakis-csp-middleware/feed)WikiDiscussions Synced 2mo ago

READMEChangelogDependencies (6)Versions (5)Used By (0)

### README not available

The README for this package hasn't been synced yet. View it on [GitHub](https://github.com/pavlakis/csp-middleware).

###  Health Score

33

—

LowBetter than 74% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity75

Established project with proven stability

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 ~1017 days

Total

3

Last Release

1263d ago

Major Versions

0.2 → 1.02022-11-22

PHP version history (2 changes)0.1PHP ^7.0|^7.1

1.0PHP ^8.1

### Community

Maintainers

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

---

Tags

middlewaresecurityheadercspcontent-security-policy

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/pavlakis-csp-middleware/health.svg)

```
[![Health](https://phpackages.com/badges/pavlakis-csp-middleware/health.svg)](https://phpackages.com/packages/pavlakis-csp-middleware)
```

###  Alternatives

[spatie/laravel-csp

Add CSP headers to the responses of a Laravel app

8519.6M19](/packages/spatie-laravel-csp)[aidantwoods/secureheaders

A PHP class aiming to make the use of browser security features more accessible.

433689.3k2](/packages/aidantwoods-secureheaders)[middlewares/csp

Middleware to add the Content-Security-Policy header to the response

1720.6k](/packages/middlewares-csp)[stevenmaguire/laravel-middleware-csp

Provides support for enforcing Content Security Policy with headers in Laravel responses.

39107.6k](/packages/stevenmaguire-laravel-middleware-csp)[ayesh/stateless-csrf

Secret-key based state-less CSRF token generator and validator for PHP 8. State-less means you do not have to store the CSRF token in session or database.

3223.3k](/packages/ayesh-stateless-csrf)[born05/craft-csp

Content Security Policy (or CSP) generator using nonces.

1110.2k](/packages/born05-craft-csp)

PHPackages © 2026

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