Security aspects concerning code written in the programming language PHP which is often used for web applications.

learn more… | top users | synonyms

2
votes
1answer
337 views

Inputting user ID's in URL?

I am currently working on functionality that will allow users to reset their passwords. My question pertains to the security in putting user ID's (a.k.a the auto increment ID's from database) in the ...
1
vote
1answer
267 views

If my website does not take any user input, is there any danger in showing my code and folder structure?

First time posting here; apologies for any mistakes I've made, please edit, retag, migrate as appropriate. I have a simple homepage whose purpose is (essentially) to contain my contact info and some ...
0
votes
1answer
591 views

How long would it take to brute force the AES encryption?

I'm trying to write a secure code that can keep my site users passwords as safe as possible. Now I'm fairly new to encryption and would like some professional opinions and suggestions. As well as a ...
1
vote
1answer
1k views

Uploading images safe of XSS, php code and virus

I know that my question has been responded lot of times, but most the responses addresses functions that I don't even use (like use include with images) and that makes me worry because maybe I'm not ...
0
votes
1answer
202 views

Website Link Spam Hacking Protection [closed]

I've recently been employed as a junior web and software developer for a small company, and noticed that their Home page has had links to completely unrelated sites added like spam to the index.html ...
2
votes
3answers
145 views

A scammer placed a remote file on a Wordpress website?

A previous developer I have used has got upset and start compromising the files of my website on daily bases (such as changing the index of the site with weird messages, deleting the .htaccess, ...
-3
votes
3answers
3k views

Generating an unguesable token for confirmation e-mails

I'm generating a token to be used when clicking on the link in a verification e-mail. I plan on using uniqid() but the output will be predictable allowing an attacker to bypass the confirmation ...
3
votes
2answers
419 views

Is mt_rand() suitable for generating a salt?

Assumed I have to following code in order to generate a random blowfish salt for saving a new password: $blowfishCharacters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789./'; $salt ...
0
votes
2answers
322 views

How do I securely identify a remote (self programmed embedded) device in PHP?

Is there a reliable way in PHP to identify a device that might be behind a Router (so the IP is not unique)? Background: I have several embedded devices (self programmed & adaptable) that contact ...
4
votes
3answers
2k views

How do I capture POST data then forward user to another page?

I currently have a demo site setup where I load the login form over HTTP and then POST to a HTTPS URL. The aim is to demonstrate that this is not a secure method of handling the login. I'm using ...
0
votes
3answers
715 views

Ways to keep AES encryption key safe.? [closed]

I am using AES encryption to secure some sensitive data. For that i have to provide a certain key for encrypting and decrypting. It's not safe to keep the key somewhere on the server. So instead of ...
8
votes
3answers
1k views

Is this code snippet good enough for password hash and salt

After a few days reading up about salting and hashing passwords, I found an actual bit of code that tells how to do it. This is what I found: $blowfish_salt = ...
-4
votes
3answers
299 views

PHP web application security [closed]

I am building a PHP web application, that needs enhanced security, due to the fact that it contains very sensitive information (in a database). I think that I want to use self-signed SSL ...
12
votes
3answers
5k views

SQL injection can bypass login but not drop table

I've setup a test environment for running some SQL Injection against my code and learning how to defend against it. I can bypass the login form using the following in the password field: ' OR ...
5
votes
1answer
193 views

SQL injection not returning expected results

I've created a test site in order to learn about SQLi and then protect against it. I may be misunderstanding how it is supposed to behave but at present I'm not getting the results I expect. The ...
0
votes
1answer
380 views

Elgamal algorithm PHP code [closed]

I was wondering if there is a PHP implementation for Elgamal algorithm for website data security ? I found that for EC, Diffie-Hellman but could not find any about elgamal. Thanks in advance.
6
votes
2answers
517 views

Modern, security-conscious, PHP book?

I posted this on StackOverflow and they redirected me here. Sorry if this isn't the correct area! After creating a simple login system and trying to protect it against things like SQL injection, ...
5
votes
2answers
5k views

Building a web app with encrypted MySQL database entries?

I have some experience in building PHP based websites with MySQL access, storing encrypted user details, but all other fields being plain text. My most recent project will require sensitive data to be ...
1
vote
2answers
111 views

Mysql database password and webform password

I have a Mysql database where one table is meant to store user complaints/comments/suggestions. I am using Mysqli to connect to the database with a ...
2
votes
2answers
486 views

Suspicious entries in MySQL database from user input forms - sql injection?

I built a website from scratch using PHP and MySQL for my residential community and our budget is a big fat '0'. Five days ago I discovered that there were 222 entries in a table in my database that ...
-1
votes
1answer
420 views

Protect against Tamper Data add-on

When it comes to uploading images on a website. I know you can trick the php to believe that the file is an image by changing the extension to ".jpg" from ".php". Then once the file is uploading you ...
3
votes
3answers
995 views

SQL injection using letters and numbers?

I was wondering if it is at all possible for a hacker to perform an SQL injection attack using just letters and numbers. For example, let's take a look at this PHP code which uses regular expressions ...
8
votes
4answers
796 views

How dangerous is it to store password in plain text on sites like GitHub?

I have a few private repositories set up on GitHub for some of the projects I am working on for my company. These applications connect to databases and I have database authentication credentials ...
1
vote
0answers
444 views

How to set up a smart card for web login? [closed]

I'm a web developer with a login system (in PHP) that I would like to extend to allow those with a smart card to sign into the system. But I have no idea where to begin and I don't have a massive ...
1
vote
5answers
1k views

Encrypt-function inside PHP code that you have to publish

If you write a PHP application, where you have to deliver the compiled code to the customer, how could you include a functionality to send encrypted data from that application to others, and include ...
2
votes
1answer
283 views

Are GET, POST and windows.location vulnerable to XSS in a Wordpress theme?

I created a Wordpress theme for my client. He told me that he scanned my theme with a vulnerability scanner, and that it has security issues with the GET and windows.location methods. Is this really ...
2
votes
3answers
3k views

How secure is ionCube compiled code?

I use ionCube to keep the code I write concealed for my customers. If I would store a password inside the code and compile (not encrypt) it with ionCube encoder, would it be possible for a potential ...
-3
votes
1answer
512 views

Cross-site request forgery attack. How can we stopped this? [closed]

On one of our websites, we are seeing this code is adding itself. I tried to figured out but no success. One thing I have noticed when I removed the html, head and body starting tags, it's gone. Our ...
3
votes
0answers
560 views

Where to store sensitive client details (MYSQL DB credentials) [duplicate]

I have a security related question about storing some client information - specifically their database login credentials. My app works based on the client and so the database details need to be set ...
0
votes
2answers
386 views

How to implement shamir's secret sharing algorithm using AES_ENCYRPT

I am using MySQL AES_ENCRYTP() and AES_DECRYPT() to store sensitive details in a database, and currently storing the key in a php file outside of the web root with read access only. The key file looks ...
1
vote
2answers
680 views

Generating session CSRF token based on SSL session ID

Following situation: Application is only accessible via HTTPS/SPDY nginx is sending the SSL session ID to the upstream server Upon session start I'd like to use the first 128 characters of that ...
0
votes
1answer
333 views

Site Hacked - Where to go from here? [closed]

Our magento based e-commerce site was hacked over the weekend, the hackers managed to gain access to the magento files and embed some scrambled code into the get.php file in the root directory. I ...
1
vote
1answer
2k views

WordPress Hacked - Found a suspicious “class-wp-style-table.php” [closed]

I recently had all of my WordPress accounts on my server hacked. The only suspicious files I found are listed below. These were the only files edited in the last 5 days (June 3, to be specific). ...
2
votes
1answer
333 views

Bot detection ideas [php]

I am looking for bot detection ideas. I don't mind bots crawling my site, that's cool, the problem is when they start posting stuff. I recently had to erase 400 accounts because of a bad boy like ...
6
votes
1answer
450 views

Is enabling PHP script execution on HTML document file extensions a security concern?

I am working on a very old and messy site, which doesn't have a CMS, or a database. However, it has a lot of .htm and .php files. I need to add some PHP code to some of the .htm files, but want to ...
-1
votes
2answers
170 views

my websites got infected with a malware i cannot get any info on [closed]

we have a server, on which we host about 30 sites. these are test sites for our customers. most of them are not even indexed by google. some run on php, some on nodejs, some on ruby. all of them that ...
4
votes
1answer
168 views

Is it possible for users to insert forbidden characters into sites with htmlentities or mysqlescapestring?

So, in my brief research in PHP security, I have been guided toward two important functions to remove forbidden characters from forms. One being "htmlentities" and the other being ...
4
votes
1answer
517 views

Malicious script analysis

Could somebody tell me what can this malicious code do? I see that in the beginning it turns off the error reporting and logging. Then something with get post method and files stuff. But I am not ...
8
votes
2answers
2k views

Exploiting PHP via GET params

To be clear, this is in the interest of ethical testing to secure an application on behalf of my work. Now that that's out of the way, here are the details: Un-sanitised GET params are used in a ...
3
votes
3answers
353 views

Understanding JVM zero day in relationship with other runtimes

I am a .net and php developer and since java has been in the news recently thanks to the string of zero days, I decided to brush up on security. In regards to the java zero days, this question has ...
9
votes
1answer
1k views

“Official statement” on php.net : CRYPT_BLOWFISH is strongest hash algorithm. Why?

First: I asked this question on stackoverflow and was kindly asked to post this here again. See the original question here. According to the [early] doc pages of the new PHP 5.5 password ...
5
votes
5answers
3k views

How to make a site vulnerable to SQLi?

I've recently taken an interest in SQL injections - it (for some reason, correct me if I'm wrong) seemed like a good place to start (I am pretty much a beginner). Anyways, I want to make a site that I ...
3
votes
2answers
2k views

Secure way to establish PHP database connections

I've read the advice (example: store them in php file in a location inaccessible as a URL) but can't help thinking there must be a better way of storing/accessing database credentials. Ideally it ...
0
votes
1answer
82 views

Security comparisons between two approaches: how to distinguish FUD from Substance? [closed]

Background: WorkerB and Tymac were discussing the pros-and-cons of using two different alternatives for extending a web content management system that is used in their company. Alternative one ...
6
votes
2answers
2k views

Is this Data Encryption/Storage Method Secure?

Let me first say that I know it is a bad idea to store sensitive information in a mysql database, so please don't respond by saying "DON'T DO IT" or something to that effect. I am building a website ...
15
votes
6answers
16k views

Is it possible for a hacker to download a php file without executing it first?

I have a php website where everything is in the public_html\ folder, including inclides folder with config and classes. I told my developer to move it away from public folder but he said there is no ...
0
votes
2answers
1k views

Stopping js malware injection on our Wordpress site

This had been added to our wordpress site, specifically in the footer.php. hxxp://pkktjuchlrv.peguards.cc/02b31ac5iq/get.js It is malware as defined by google, i belive it is tracking code. We have ...
2
votes
2answers
209 views

Are these two ways safe?

I have two scenarios and want to know if each is secure or which risk there are. Number One: If the User has the edit Link (edit/[md5hash]) he can edit a post. The editkey (the hash) is in an form ...
3
votes
1answer
141 views

PHP - Serializing user inputs

My entropy gathering system works by serializing user inputs: $entropy=sha1(microtime().$pepper.$_SERVER['REMOTE_ADDR'].$_SERVER['REMOTE_PORT']. ...
7
votes
1answer
445 views

Does HTTPS Encrypt PHP Arguments?

I am working on a web app that will need to have a secret key(s) passed from one server to another - I'll need to do this over PHP. Consider the following URL: ...