wireghoul / safelity

Secure programming library for PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

safelity

Secure programming library for PHP, written as a proof of concept by Eldar "Wireghoul" Marcussen - http://www.justanotherhacker.com. Developed as part of my presentation at GIDS on codified security.

Concept

The idea was to write a library that allows developers to write secure code in a way that is similar to how they would write code otherwise. This library ensures that the code only executes the intended functionality without the need for input validation or encoding of special characters. In order to achieve this, some limitations were introduced. The following requirements/objectives were set:

  • PHP
  • Linux
  • Web based usage
  • Small adjustment for developers
  • No need for input validation
  • Auditable

PoC

Security claims should not be made lightly, a challenge to hack the library was made public on the internet. While the challenge is no longer hosted example scripts are provided in the poc/ directory and you can try to hack them yourself:

cd poc/
php -S 0:8000

The challenge files are now accessible via http://localhost:8000/ in your browser.

Usage of the library can also be audited by running ./audit.sh <directory> from the command line.

Inspiration

This library was inspired by a number of posts/opinions, but the following deserve a special mention:

About

Secure programming library for PHP

License:GNU Affero General Public License v3.0


Languages

Language:PHP 61.1%Language:Hack 28.0%Language:Shell 10.9%