Tagged Questions
6
votes
3answers
794 views
Is there any SQL injection for this PHP login example?
I want to write a login form, and I got one example from the web.
I want to know, if there is any SQL injection for this code? If there is, what could the exploit's web form entry look like?
This is ...
2
votes
3answers
181 views
Secure login system - using sessions?
I'm looking for a secure way to let users login on my website. Currently, I've always used a session system, like this:
<?php
session_start();
if (validPass() || isset($_SESSION['userId'])) {
...
2
votes
1answer
130 views
When checking a session variable to see if a user is logged in, is it enough to check to see if the variable is set?
When displaying a page with content only logged in users should see, I simply check
if(isset($_SESSION['hasLoggedIn']))
{
//show content
}
else
{
echo 'you must log in';
}
In this article it ...
2
votes
4answers
275 views
When logging out of a website is anything else required then destroying the session?
In PHP, I'm not sure if I should start the session before destroying it when a user wants to log out.
session_start();
session_destroy();
Is there anything else that needs to be done?
EDIT: I ...
1
vote
2answers
129 views
How high is the entropy of this salt-generating code? (No code-reading actually necessary)
What is the best method?
Assumption: I have a function that generates a number of medium-high entropy bytes
Step1:
I generate 3 of these medium-high entropy bytes.
Step2:
I hash these bytes using a ...
0
votes
1answer
171 views
Protect database resources from fake data inputs via web forms
Scenario:
I'm working on a project that needs to accept large amounts of data (customer data) from its users. So it can be normal to have a user trying to add 10,000 or 100,000 records at a time. In ...
1
vote
1answer
261 views
Implementing SRP Challenge login system *with SSL* (Using PHP)
My question: Anyone knows how to implement SRP / Diffie-Hellman authentication in PHP (or if this has already been done)?
(Some details)
I'm using CodeIgniter with TankAuth (both latest version)
...
2
votes
1answer
133 views
Safe User Login Questions
I need help determining how safe the login is. First of all, I have been reading this:
The Definitive Guide To Forms based Website Authentication
It's really well written, great information most of ...
3
votes
3answers
1k views
Do you need to encrypt session data?
I came across a session management class in PHP which encrypts session data in the session storage folder (i.e., /tmp) and can be decrypted later in your script using a key. I was wondering if it's ...
5
votes
2answers
640 views
Could this login form be “hacked” to allow access?
We have this legacy website which has horrendous code in it. I have just been looking through the login form/code and can see un-sanitised sql queries. E.g. in a nutshell:
$email=$_POST['email'];
...
1
vote
3answers
294 views
Login System Security Suggestions
I am creating a login system and was wondering if anybody had any suggestions. Here is my current setup:
nonce to check if the login originated from our login form
session and cookie auth mixed - in ...
4
votes
1answer
483 views
Is this admin area secure enough? V2
This is a response to my previous question, Is this admin area secure enough?.
There were some very helpful answers there, for which I am very grateful. So I went back to the drawing board and here ...
3
votes
3answers
322 views
Is this admin area secure enough?
EDIT: Please view the revised question instead
The admin area has special access to the database (modifying orders, etc).
To help explain, I drew a diagram, so here is my process:
Notes:
I ...
6
votes
2answers
138 views
What to consider when generating random code as part of two-factor authentication?
I want to write a patch for a two factor authentication system that someone else has started. The code is a module for a PHP content management system and sends an SMS message to a user's phone, after ...
1
vote
2answers
172 views
TCrypto - Comments about design decisions I made?
I have pushed some code to GitHub to demonstrate the usage of symmetric key encryption in PHP. It is a small key-value storage library and it (optionally) offers ability to encrypt the stored ...
4
votes
2answers
270 views
Attack vectors in POSTing variables from one php script to the next?
I have an application which is structured in the following way for its signup page. After this signup, the user is directly granted access into the system - there is no email verification (as ...
25
votes
5answers
2k views
How to Securely Implement a “Remember Me” Feature?
Assuming you already have a website that implements all of the standard login stuff, what is the correct and most secure way to allow users to automatically be logged in for a certain time period ...