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

ActiveMarko-module[Security](/categories/security)

marko/security
==============

Security middleware for Marko Framework -- CSRF protection, CORS handling, and security headers

0.7.0(3mo ago)090↓22.2%MITPHPPHP ^8.5

Since Mar 25Pushed 4w agoCompare

[ Source](https://github.com/marko-php/marko-security)[ Packagist](https://packagist.org/packages/marko/security)[ RSS](/packages/marko-security/feed)WikiDiscussions develop Synced 3w ago

READMEChangelogDependencies (24)Versions (18)Used By (0)

marko/security
==============

[](#markosecurity)

CSRF protection, CORS handling, and security headers middleware -- secure your routes with drop-in middleware.

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

[](#installation)

```
composer require marko/security
```

Quick Example
-------------

[](#quick-example)

```
use Marko\Routing\Attributes\Post;
use Marko\Routing\Attributes\Middleware;
use Marko\Security\Middleware\CsrfMiddleware;

class FormController
{
    #[Post('/contact')]
    #[Middleware(CsrfMiddleware::class)]
    public function submit(): Response
    {
        // Token validated automatically
        return new Response('Submitted');
    }
}
```

Documentation
-------------

[](#documentation)

Full usage, API reference, and examples: [marko/security](https://marko.build/docs/packages/security/)

###  Health Score

42

—

FairBetter than 89% of packages

Maintenance89

Actively maintained with recent releases

Popularity13

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

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

Total

16

Last Release

92d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/437029?v=4)[Mark Shust](/maintainers/markshust)[@markshust](https://github.com/markshust)

---

Top Contributors

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

### Embed Badge

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

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

PHPackages © 2026

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