Giter Site home page Giter Site logo

marcocesarato / php-aio-security Goto Github PK

View Code? Open in Web Editor NEW
37.0 8.0 14.0 895 KB

The objective of this class is offer an automatic system of protection for developers's projects and simplify some security operations as the check of CSRF or XSS all in a simple class. Infact you could just call the main method to have better security yet without too much complicated operations.

License: GNU General Public License v3.0

PHP 100.00%
php security xss csrf hijacking clickjacking injection sql class autocomplete

php-aio-security's Introduction

Hi there ๐Ÿ‘‹

I'm Marco Cesarato, a Italian Fullstack Software Engineer.

I'm a weird guy ๐Ÿ‘ฝ who likes making weird things with the technology.

I like to resolve problems, create smart user interfaces and imagine useful interaction, developing rich web experiences & good web and mobile applications. I care about creating high-quality, in terms of UI/UX ๐Ÿ”ญ and performance ๐Ÿš€, applications.

I know likely all the most popular programming languages ๐Ÿ˜†, but I'm ready to pick up new one ๐ŸŒฑ.

  • ๐Ÿ‘ถ Programming since: 2012
  • ๐Ÿ“š Interests: I'm always interested in learning
  • ๐Ÿ˜ Favorite Programming Language: probably are TypeScript and Python, because they can be well structured and is dynamic at the same time, don't need too much external libaries and its learning cost is very low, saving more valuable time
  • ๐ŸŽฎ Hobbies: I like to play to League of Legends and I think to be a decent player, peak elo Master ๐Ÿ˜ƒ

php-aio-security's People

Contributors

imgbotapp avatar marcocesarato avatar renovate[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

php-aio-security's Issues

Incorrect column name

As i know, the id column should be INTEGER, in your case there is no id column, there is an ip column, so why don't you change in the following way?
line: 188

id VARCHAR(128) NOT NULL,

maybe better to change to:

ip VARCHAR(128) NOT NULL,

?

Because as i know the id column should look like:

id INT(11) NOT NULL AUTO_INCREMENT...

and PRIMARY KEY should be INTEGER, am i right? So, if you want, you can just add id before ip column, maybe it whould be better?

Closing Session Issue

Hi Marco,

For some reason my logout stops working with the security class activated. Any idea why that is happening?

My logout code is:

session_start();
$_SESSION = array();
session_unset();
session_destroy();
header("location: index.php");

I also tried to delete the cookies with the code below but seems that it's not helping...

if (ini_get("session.use_cookies")) {
    $params = session_get_cookie_params();
    setcookie(session_name(), '', time() - 42000,
        $params["path"], $params["domain"],
        $params["secure"], $params["httponly"]
    );
}

Thanks.

Fatal Error on PHP 8

Unfortunately seems that the class is not working properly on PHP 8...

Any plans to update?

Session Closing After 5 Seconds

Hi Marco,

For some reason sometimes the session closes too quickly (after 5 or 10 seconds). In the class Security the session lifetime is public static $session_lifetime = 288000;

Any idea why this is happening?

Undefined index: _CSRFTOKEN

Hi Marco,

I'm trying to use your code but for some reason my forms just stop working when the class is activated, I keep getting the "_Undefined index: CSRFTOKEN" error on post request.

On this line:

$GLOBALS[self::$csrf_session . $csrf_key] = $_SESSION[self::$csrf_session . $csrf_key];
$token                                    = $GLOBALS[self::$csrf_session . $csrf_key];

Any idea what im doing wrong?

Thanks,

secureHTML Breaking the Template

Hi Marco,

It seems that the function "static function secureHTML" is breaking my template.

I think the code $doc->loadHTML($buffer); is responsible for the issue since everything seems to work until that that line...

Any idea why is happening and how I can fix it without just disabling the function?

Working Very Slow

Respected Developers, Its work very slow and take times too to response.It always return Permission deny when user input some JS codes.

Security Class renaming script type="application/ld+json"

Hi Marco,

Hope you are doing well in this current climate.

Seems that the security class is renaming the <script type="application/ld+json"> (used for Google markups) to <script type="text/javascript"> creating several issues.

Any idea how I can fix this issue without disabling the class?

Thanks,

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.