NAME
Plack::Middleware::Security::Simple - A simple security filter for Plack
SYNOPSIS
use Plack::Builder;
builder {
enable "Security::Simple",
rules => [
PATH_INFO => qr{^/cgi-bin/},
PATH_INFO => qr{\.(php|asp)$},
HTTP_USER_AGENT => qr{BadRobot},
];
...
};
DESCRIPTION
This module provides a simple security filter for PSGI-based applications, so that you can filter out obvious exploit-seeking scripts.
Note that as an alternative, you may want to consider using something like https://modsecurity.org|modsecurity as a filter in a reverse proxy.
RECENT CHANGES
Changes for version v0.13.1 (2026-05-26)
- Security
- Fixed the header_injection rule CVE-2026-9658.
- Enhancements
- Added a misc_vulns rule.
- Documentation
- Updated author email address.
- Updated copyright year.
- Added doap.xml.
- Fixed broken links in POD.
- Fixed typos in POD.
- README is generated by the UsefulReadme plugin.
- Tests
- Added more author tests, and moved them into the xt directory.
- Toolchain
- Stopped signing distributions with Module::Signature (which is deprecated)
See the Changes file for more details.
REQUIREMENTS
This module lists the following modules as runtime dependencies:
- Exporter::Tiny
- HTTP::Status
- Hash::Match
- Plack::Middleware
- Plack::Response
- Plack::Util::Accessor
- Ref::Util
- Regexp::Common
- parent
- perl version v5.14.0 or later
- warnings
See the cpanfile file for the full list of prerequisites.
INSTALLATION
The latest version of this module (along with any dependencies) can be installed from CPAN with the cpan tool that is included with Perl:
cpan Plack::Middleware::Security::Simple
You can also extract the distribution archive and install this module (along with any dependencies):
cpan .
You can also install this module manually using the following commands:
perl Makefile.PL
make
make test
make install
If you are working with the source repository, then it may not have a Makefile.PL file. But you can use the Dist::Zilla tool in anger to build and install this module:
dzil build
dzil test
dzil install --install-command="cpan ."
For more information, see the INSTALL file included with this distribution.
BUGS
Please report any bugs or feature requests on the bugtracker website https://github.com/robrwo/Plack-Middleware-Security-Simple/issues
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
Reporting Security Vulnerabilities
Security issues should not be reported on the bugtracker website. Please see SECURITY.md for instructions how to
report security vulnerabilities.
SOURCE
The development version is on github at https://github.com/robrwo/Plack-Middleware-Security-Simple and may be cloned from https://github.com/robrwo/Plack-Middleware-Security-Simple.git
AUTHOR
Robert Rothenberg perl@rhizomnic.com
COPYRIGHT AND LICENSE
This software is Copyright (c) 2014,2018-2026 by Robert Rothenberg.
This is free software, licensed under:
The Artistic License 2.0 (GPL Compatible)