PHPackages                             codeinc/security-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. codeinc/security-middleware

AbandonedArchivedLibrary[Security](/categories/security)

codeinc/security-middleware
===========================

A collection of PSR-15 middleware to manage HTTP security

1.1.3(7y ago)034MITPHPPHP &gt;=7.1

Since May 3Pushed 7y ago1 watchersCompare

[ Source](https://github.com/CodeIncHQ/SecurityMiddleware)[ Packagist](https://packagist.org/packages/codeinc/security-middleware)[ Docs](https://github.com/CodeIncHQ/SecurityMiddleware)[ RSS](/packages/codeinc-security-middleware/feed)WikiDiscussions master Synced 3w ago

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

Security PSR-15 middlewares
===========================

[](#security-psr-15-middlewares)

This library provides a collection of [PSR-15](https://www.php-fig.org/psr/psr-15/) middleware to manage HTTP security.

The collection includes
-----------------------

[](#the-collection-includes)

- [`ContentSecurityPolicyMiddleware`](src/ContentSecurityPolicyMiddleware.php) Adds a [`Content-Security-Policy`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Content-Security-Policy) HTTP headers to the response
- [`ContentTypeOptionsMiddleware`](src/ContentTypeOptionsMiddleware.php) Adds a [`X-Content-Type-Options`](https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Content-Type-Options) HTTP headers to the response
- [`ExpectCtMiddleware`](src/ExpectCtMiddleware.php) Adds a [`Expect-CT`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Expect-CT) HTTP headers to the response
- [`FrameOptionsMiddleware`](src/FrameOptionsMiddleware.php) Adds a [`X-Frame-Options`](https://developer.mozilla.org/docs/Web/HTTP/Headers/X-Frame-Options) HTTP headers to the response
- [`ReferrerPolicyMiddleware`](src/ReferrerPolicyMiddleware.php) Adds a [`Referrer-Policy`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Referrer-Policy) HTTP headers to the response
- [`StrictTransportSecurityMiddleware`](src/StrictTransportSecurityMiddleware.php) Adds a [`Strict-Transport-Security`](https://developer.mozilla.org/docs/Web/HTTP/Headers/Strict-Transport-Security) HTTP headers to the response
- [`XssProtectionMiddleware`](src/XssProtectionMiddleware.php) Adds a [`X-Xss-Protection`](https://developer.mozilla.org/docs/Web/HTTP/Headers/X-XSS-Protection) HTTP headers to the response
- [`BlockUnsecureRequestsMiddleware`](src/BlockUnsecureRequestsMiddleware.php) Blocks unsecure (other than `HTTPS`) requests responses

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

[](#installation)

This library is available through [Packagist](https://packagist.org/packages/codeinc/security-middleware) and can be installed using [Composer](https://getcomposer.org/):

```
composer require codeinc/security-middleware
```

💬 This library is extracted from the now deprecated [codeinc/psr15-middlewares](https://packagist.org/packages/codeinc/psr15-middlewares) package.

License
-------

[](#license)

The library is published under the MIT license (see [`LICENSE`](LICENSE) file).

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity63

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

Recently: every ~38 days

Total

7

Last Release

2824d ago

### Community

Maintainers

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

![](https://www.gravatar.com/avatar/8f72f949d7f70e400c02c225685f1934dec6219689f25edec38b4037df166d58?d=identicon)[codeinc](/maintainers/codeinc)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/codeinc-security-middleware/health.svg)

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

###  Alternatives

[cakephp/cakephp

The CakePHP framework

8.9k19.5M1.8k](/packages/cakephp-cakephp)[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)[cakephp/authentication

Authentication plugin for CakePHP

1214.1M101](/packages/cakephp-authentication)[typo3/cms-core

TYPO3 CMS Core

3713.2M5.0k](/packages/typo3-cms-core)[typo3/cms-adminpanel

TYPO3 CMS Admin Panel - The Admin Panel displays information about your site in the frontend and contains a range of metrics including debug and caching information.

115.7M65](/packages/typo3-cms-adminpanel)[flarum/core

Delightfully simple forum software.

201.4M2.3k](/packages/flarum-core)

PHPackages © 2026

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