PHPackages                             mbretter/stk-csrf - 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. mbretter/stk-csrf

ActiveLibrary[Security](/categories/security)

mbretter/stk-csrf
=================

Stk CSRF service and middleware

1.2.0(3y ago)02.7kBSD-3-ClausePHPPHP ^7.4|^8.0CI failing

Since Oct 8Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mbretter/stk-csrf)[ Packagist](https://packagist.org/packages/mbretter/stk-csrf)[ Docs](https://www.bretterklieber.com)[ RSS](/packages/mbretter-stk-csrf/feed)WikiDiscussions master Synced 1mo ago

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

CSRF for php
============

[](#csrf-for-php)

[![License](https://camo.githubusercontent.com/2b599ab1ace97388d4375b87919f92781a1a61d016fe640a5c4d15fc365deed1/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4253442d626c75652e737667)](https://opensource.org/licenses/BSD-3-Clause)[![PHP 7.4](https://camo.githubusercontent.com/055d0ad49ccce6b1ae1a28a6bb76ae4821acc50472e5c51c097b25238b0a0483/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d372e342d79656c6c6f772e737667)](http://www.php.net)[![Build Status](https://camo.githubusercontent.com/2a53712b2009ac81b4a63c9d1ce1e2399a3c8bffa5094eb55239909cbf545b9e/68747470733a2f2f7472617669732d63692e6f72672f6d627265747465722f73746b2d637372662e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/mbretter/stk-csrf)[![Coverage](https://camo.githubusercontent.com/23a7e6492a2ef4d0757a957083fdc1f80cc5834fb6ae705a2efb23065fe8bf99/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f6d627265747465722f73746b2d637372662f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/mbretter/stk-csrf?branch=master)[![Latest Stable Version](https://camo.githubusercontent.com/fcb86626b8df2e17a66b02f97d876d995431ac90e75ddff02c80d3c5d1603852/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d627265747465722f73746b2d637372662e737667)](https://packagist.org/packages/mbretter/stk-csrf)[![Total Downloads](https://camo.githubusercontent.com/651139d5ecf441f128bad71aa82e2ead5457cb1b728d7f5b733c52a02344de77/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d627265747465722f73746b2d637372662e737667)](https://packagist.org/packages/mbretter/stk-csrf)

CSRF Service and PSR/Slim3 middleware

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity68

Established project with proven stability

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

Recently: every ~157 days

Total

8

Last Release

1369d ago

Major Versions

0.4.0 → 1.0.02021-02-02

PHP version history (3 changes)0.1.0PHP ^7.2

1.0.0PHP ^7.4

1.1.0PHP ^7.4|^8.0

### Community

Maintainers

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

---

Top Contributors

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

---

Tags

csrfstk

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StylePHP CS Fixer

Type Coverage Yes

### Embed Badge

![Health badge](/badges/mbretter-stk-csrf/health.svg)

```
[![Health](https://phpackages.com/badges/mbretter-stk-csrf/health.svg)](https://phpackages.com/packages/mbretter-stk-csrf)
```

###  Alternatives

[selective/samesite-cookie

Secure your site with SameSite cookies

10144.0k](/packages/selective-samesite-cookie)[aura/session

Provides session management functionality, including lazy session starting, session segments, next-request-only ("flash") values, and CSRF tools.

2041.2M67](/packages/aura-session)[paragonie/anti-csrf

Paragon Initiative's Anti-CSRF Security Library

307200.6k5](/packages/paragonie-anti-csrf)[owasp/csrf-protector-php

CSRF protector php, a standalone php library for csrf mitigation in web applications. Easy to integrate in any php web app.

222348.3k3](/packages/owasp-csrf-protector-php)[kunststube/csrfp

A signed token generator for cross site request forgery protection.

52209.5k1](/packages/kunststube-csrfp)[riimu/kit-csrf

Secure and simple CSRF library protected against timing and BREACH attacks

6526.1k](/packages/riimu-kit-csrf)

PHPackages © 2026

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