Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHP Backend Input Sanitizing #9

Open
Philwlv opened this issue Mar 1, 2020 · 6 comments
Open

PHP Backend Input Sanitizing #9

Philwlv opened this issue Mar 1, 2020 · 6 comments
Assignees
Labels
bug Something isn't working security Potential security issues

Comments

@Philwlv
Copy link
Collaborator

Philwlv commented Mar 1, 2020

/// Creates an INSERT INTO query using the given data
function BuildQuery($usid, $name, $email, $password)
{
$query = "INSERT INTO user (admin_id, admin_name, admin_email, admin_password)";
$query = "$query VALUES ('$usid', '$name', '$email', '$password')";
return $query;
}

Believe 'BuidQuery' function will need prepared statements and filtering/sanitizing. @matthewward00 #7

@Philwlv Philwlv added the security Potential security issues label Mar 1, 2020
@Philwlv
Copy link
Collaborator Author

Philwlv commented Mar 1, 2020

I wanted to put this in with #7, You may have to educate me on how to do that lol.

@JoshLmao
Copy link
Member

JoshLmao commented Mar 1, 2020

You only need to make one issue which covers the whole problem which you already did but it's not a problem. Rather than having millions of issues with the same thing just make one and use it. We'll use this one for now.

Don't worry about assigning people either. Usually us dev's do that 😉

@JoshLmao JoshLmao removed their assignment Mar 1, 2020
@JoshLmao JoshLmao changed the title Function BuildQuery PHP Backend Input Sanitizing Mar 1, 2020
@JoshLmao
Copy link
Member

JoshLmao commented Mar 1, 2020

If you find any more examples where sanitizing needs to be done, put them in here please

@Philwlv
Copy link
Collaborator Author

Philwlv commented Mar 1, 2020

sure, how do I do that? I tried to add this to the previous one. You can tell im getting into it now, assigning people and adding labels, Whooo. 😆 🤦‍♂

I wont do this every day 😆 I'll do a few and come back a few days later. I don't wona be that annoying, only a little bit annoying 😄

@JoshLmao
Copy link
Member

JoshLmao commented Mar 1, 2020

Good on you! Haha

Do the selecting an area of code like normal, but instead of clicking "Reference in New Issue" click the "Copy Permalink" one. Then go to comment like normal and paste the link

@Philwlv
Copy link
Collaborator Author

Philwlv commented Mar 11, 2020

function BuildQuery($id)
{
$query = "UPDATE assets SET owner_name = NULL, owner_address = NULL, owner_date_recieved = NULL, owner_date_return = NULL WHERE assets.id = $id";
return $query;
}

This input $id will need filtering and the query will need putting in a prepared statement.

@Philwlv Philwlv added the bug Something isn't working label Mar 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working security Potential security issues
Projects
None yet
Development

No branches or pull requests

3 participants