A multitool library offering access to recommended security related libraries, standardised implementations of security defences, and secure implementations of commonly performed tasks.

Overview

SecurityMultiTool

A multitool library offering access to recommended security related libraries, standardised implementations of security defences, and secure implementations of commonly performed tasks.

The purpose of the library is to serve as both a useful set of utilities and to act as a set of reference implementations which can be learned from. It may be used by applications regardless of whether they are web application framework based or not. The use of a web application framework does not guarantee your security.

Yet Another Security Library?

There are actually few security related metapackages available in PHP and many are outdated and/or insecure. Feeding this problem is a lack of concrete information about best practices in PHP. SecurityMultiTool extracts source code, patterns and best practices from a variety of sources to offer a singular point of reference. The source code will be opinionated. For example, SecurityMultiTool\Html\Sanitizer uses HTMLPurifier and does not allow for that dependency to be substituted (because there is NO other secure HTML sanitizer in PHP!).

You may choose to use SecurityMultiTool as a dependency in your projects. You can use it as a useful set of examples of what you should be doing. You can use it as a benchmark to check if your own code and its dependencies are straying from the recommended path. You can copy and paste the code to fit your needs (and I won't go beserk if you don't attribute me). You can pass around URLs to the code, if useful, to recommend improved practices to others.

I'm more than happy to accept PRs for new features with the understanding that they should be rigorously tested, provably secure and in compliance with secure practices.

Current Features

The following features are available and tested as of 18 March 2013:

  1. HTML Output Escaping (SecurityMultiTool\Html\Escaper)
  2. HTML Sanitization (SecurityMultiTool\Html\Sanitizer)
  3. Random Number/Bytes Generator (SecurityMultiTool\Random\Generator)
  4. HTTP Strict-Transport-Security & X-CSRFToken Headers (SecurityMultiTool\Http\Header)
  5. HTTPS Detector (SecurityMultiTool\Http\HttpsDetector)
  6. Sanitized Markdown and BBCode Parsers (SecurityMultiTool\Markdown|BBcode\Parser)
  7. Anti Timing-Attack String Comparison (SecurityMultiTool\String\FixedTimeComparison)

The following libraries are dependencies installed with SecurityMultiTool which you may use independently of SecurityMultiTool:

There is a lot more to come!

Reporting Security Vulnerabilities

If you locate a potential vulnerability in the source code, you should report it directly to [email protected]. I undertake to resolve any such reports within 30 days of receipt and I will confirm receipt of any report within 3 days. Any resolving source code will be made available to the reporter for review prior to it being committed to this repository. You are free to publicly disclose any vulnerability, once fixed or after any period you require when sending a report, as you should already know.

You might also like...
Advance features / Topics related to Laravel

Laravel Advance Topics Notes Includes : v1.0.0 - Service Container v1.1.0 - View Composer v1.2.0 - Polymorphic Relationships v1.3.0 - Custom Facade Im

Keyword Generator Tool helps you discover keyword opportunities related to your query input.
Keyword Generator Tool helps you discover keyword opportunities related to your query input.

This plugin simply helps you discover keyword opportunities related to your query input. Installation Download the zip file of the repository or clone

Easy way to upload Laravel model related files from the request.

Easy way to upload laravel model related file from the requset.

Taskpm - Run multi tasks by PHP multi process

php-pkg-template Run multi tasks by PHP multi process Install composer composer require phppkg/taskpm Usage github: use the template for quick create

Foreman is a Laravel scaffolding application that automates common tasks you typically perform with each new Laravel app you create
Foreman is a Laravel scaffolding application that automates common tasks you typically perform with each new Laravel app you create

Foreman is a Laravel scaffolding application that automates common tasks you typically perform with each new Laravel app you create. The directives you want Forman to perform are outlined in a JSON based template file.

Hashtopolis is a multi-platform client-server tool for distributing hashcat tasks to multiple computers.
Hashtopolis is a multi-platform client-server tool for distributing hashcat tasks to multiple computers.

Hashtopolis is a multi-platform client-server tool for distributing hashcat tasks to multiple computers. The main goals for Hashtopolis's development are portability, robustness, multi-user support, and multiple groups management.

Laravel Package for TMDB ( The Movie Database ) API. Provides easy access to the wtfzdotnet/php-tmdb-api library.

Laravel Package for TMDB API Wrapper A Laravel package that provides easy access to the php-tmdb/api TMDB (The Movie Database) API wrapper. This packa

MySecureVault is the most secure passwords, notes and files vault on the Internet.

MySecureVault MySecureVault is the most secure passwords, notes and files vault on the Internet. It has been developed with ultimate privacy and secur

PHP Secure Headers

Secure Headers Add security related headers to HTTP response. The package includes Service Providers for easy Laravel integration. Version Installatio

Comments
  • Updates Zend/Uri to version 2.2.x

    Updates Zend/Uri to version 2.2.x

    I have changed composer.json file to Zend/Uri 2.2.x - all tests run without any errors.

    I need this to update my project from ZF 2.1.x components to ZF 2.2.x components.

    opened by DennisBecker 1
  • Typo in Generator.php?

    Typo in Generator.php?

    I'm wondering if maybe there's a typo in Generator.php lines 37-41:

    if (true === $strong && false === $checkAlternatives) { throw new Exception\RuntimeException ( 'Unable to generate sufficiently strong random bytes due to a lack ', 'of sources with sufficient entropy' );

    I was testing to make sure Generator.php really would throw this exception, so for a quick check, I hard coded execution to flow through this block, and I got an argument error for the exception constructor. I'm wondering if the comma in-between the 2 strings is supposed to be a period (for concatenation). I tried the substitution and it seemed to work properly.

    opened by ElliotMtb 0
  • Fatal error: Can't inherit abstract function

    Fatal error: Can't inherit abstract function

    Fatal error: Can't inherit abstract function SecurityMultiTool\Common\OptionsInterface::setOption() (previously declared abstract in SecurityMultiTool\Common\AbstractOptions) in .../vendor/padraic/security-multitool/library/SecurityMultiTool/Html/Sanitizer.php on line 9
    

    after

    new SecurityMultiTool\Html\Sanitizer('cache');
    

    on PHP 5.3.6

    Actually it's happening on PHP < 5.3.9

    opened by wkiril 0
Owner
Pádraic Brady
Grumpy Irish Security Obsessed PHP programmer. Creator of @Mockery and @Humbug. Contributor to @ZendFramework. I write, code, hike and study astronomy.
Pádraic Brady
Gallium is a TALL stack starter kit offering a robust set of options enabling you to get up and running in a snap.

Very short description of the package This is where your description should go. Try and limit it to a paragraph or two, and maybe throw in a mention o

null 1 Nov 20, 2021
An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality.

Support An opinionated support package for Laravel, that provides flexible and reusable helper methods and traits for commonly used functionality. Ins

Ian Olson 3 Apr 14, 2021
In Laravel, we commonly face the problem of adding repetitive filtering code, this package will address this problem.

Filterable In Laravel, we commonly face the problem of adding repetitive filtering code, sorting and search as well this package will address this pro

Zoran Shefot Bogoevski 1 Jun 21, 2022
Product admin and edit implementations for the WLTDO framework.

Woo Let The Devs Out | Product Admin Module To be used either as a standalone module or library, or as part of the WLTDO framework, this module intend

null 2 Nov 22, 2021
Hoa is a modular, extensible and structured set of PHP libraries

Hoa is a modular, extensible and structured set of PHP libraries. Moreover, Hoa aims at being a bridge between industrial and research worlds. Hoa\Rul

Hoa 624 Dec 30, 2022
Invoices, Expenses and Tasks built with Laravel and Flutter

Invoice Ninja Hosted | Self-Hosted We're on Slack, join us at slack.invoiceninja.com or if you like StackOverflow Just make sure to add the invoice-ni

Invoice Ninja 6.8k Dec 26, 2022
The University of Arizona Libraries will no longer provide support for Guide on the Side.

The University of Arizona Libraries will no longer provide support for Guide on the Side. The code will remain openly available; however, UAL can no longer provide code fixes or upgrades.

The University of Arizona Libraries 66 Oct 31, 2022
Handle all the hard stuff related to EU MOSS tax/vat regulations, the way it should be.

VatCalculator Handle all the hard stuff related to EU MOSS tax/vat regulations, the way it should be. Integrates with Laravel and Cashier — or in a st

Dries Vints 1.1k Jan 5, 2023
Handle all the hard stuff related to EU MOSS tax/vat regulations, the way it should be.

VatCalculator Handle all the hard stuff related to EU MOSS tax/vat regulations, the way it should be. Integrates with Laravel and Cashier — or in a st

Dries Vints 1.1k Jan 7, 2023
laravel-vat is a package that contains the Laravel related wiring code for ibericode/vat

laravel-vat is a package that contains the Laravel related wiring code for ibericode/vat, helping you deal with VAT legislation for businesses based in the EU.

Danny van Kooten 117 Dec 5, 2022