Giter Site home page Giter Site logo

kastatus's Introduction

kastatus's People

Contributors

dhwanilvyas avatar mracos avatar owenvoke avatar

Watchers

 avatar  avatar  avatar

kastatus's Issues

[Insight] Database queries should use parameter binding - in login/index.php, line 10

in login/index.php, line 10

If provided by the user, the value of mysqli_real_escape_string($db_conn, $_POST['username']) may allow an SQL injection attack. Avoid concatenating parameters to SQL query strings, and use parameter binding instead.

      include '../head.php';
      include '../backend/funcs.php';
      $db_conn = \funcs\Functions::conn();

      if (isset($_POST['login']) && $_POST['username'] !== '' && $_POST['password'] !== '') {
          $sql = "SELECT password FROM `users` WHERE username='".mysqli_real_escape_string($db_conn, $_POST['username'])."'";
          $res = \funcs\Functions::query($db_conn, $sql);
          while ($row = mysqli_fetch_assoc($res)) {
              $hash = $row['password'];
          }
          $verified = password_verify($_POST['password'], $hash);

Posted from SensioLabsInsight

Add php sessions for logging in/using the admin area

Need to add PHP session usage for the login/admin areas.

So, when logging in it sets the session with the following details:

$_SESSION['user'] = (object) [
    "id" => "%USERID%",
    "username" => "%USER%",
    "loginDate" => "%DATE%"
];

And on the admin page, check that $_SESSION['user'] is set and isn't equal to null.

This is quite an easy one, so anyone who wants it, just comment below. ๐Ÿ˜„

If you need any help, let me know.

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.