…Once we've gone to the trouble of sanitizing our data, we want to keep…track of that data, and keep track of the fact that we've sanitized it already.…We wouldn't want to sanitize it twice.…And we also want to be able to tell the difference between…data that's safe to use, and…data that's still unsanitized and potentially dangerous.…One way that you can do that is by using variable names as…labels to help us to keep track of the current state of the data.…Words that might be used to describe unsafe…data would be dirty, raw, tainted or unsafe.…And data that's been sanitized could be…referred to as clean, filtered, sanitized or safe.…
I'm sure you can think of others, and you can…come up with your own, custom way of doing this.…The key thing is to give yourself an…identifier so that you can tell the difference.…Let's see an example.…Let's say that we're pulling in an email address from a form.…So that value will reside in the POST super global.…When we bring it into PHP to work with it,…out of POST super global, we're going to assign it to raw_email.…
Author
Released
6/30/2014- Cross-site scripting (XSS)
- Cross-site request forgery (CSRF)
- SQL injection
- Encrypting and signing cookies
- Session hijacking and fixation
- Securing uploaded files
- User authentication
- Throttling brute-force attacks
- Blacklisting IPs
- Implementing password reset tokens
Skill Level Intermediate
Duration
Views
Related Courses
-
Advanced PHP: Debugging Techniques
with Jon Peck1h 29m Intermediate
-
Introduction
-
Welcome59s
-
Using the exercise files1m 8s
-
-
1. Security Overview
-
What is security?3m 37s
-
Security and PHP2m 56s
-
General security principles4m 24s
-
-
2. Securing Your PHP Installation
-
Keeping versions up to date2m 51s
-
phpinfo and phpMyAdmin4m 11s
-
Configure register globals4m 19s
-
Configure error reporting7m 52s
-
Configuring magic quotes3m 2s
-
Configuring safe mode3m 1s
-
Other configurations6m 34s
-
PHP on a shared host2m 50s
-
-
3. Filtering Input and Controlling Output
-
Validating input13m 18s
-
Sanitizing data11m 30s
-
Labeling variables2m 29s
-
Keeping code private7m 3s
-
Smart logging3m 40s
-
-
4. Defending against the Most Common Attacks
-
SQL injection7m 2s
-
URL manipulation1m 51s
-
Faked requests and forms6m 17s
-
Cookie visibility and theft5m 41s
-
Encrypting cookies8m 56s
-
Signing cookies5m 41s
-
Session hijacking and fixation11m 50s
-
Remote system execution7m 5s
-
PHP code injection7m 6s
-
Securing uploaded files9m 14s
-
Setting file permissions8m 39s
-
Limiting upload file size5m 39s
-
Validating file types9m 16s
-
5. Encryption and User Authentication
-
Password encryption7m 6s
-
Password requirements2m 14s
-
Authentication in PHP12m 58s
-
Throttling brute-force attacks10m 37s
-
Blacklisting IP addresses6m 41s
-
-
Conclusion
-
Next steps44s
-
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.
CancelTake notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.
Share this video
Embed this video
Video: Labeling variables