 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Evert Pot's Blog: Creating Streams from Strings in PHP
by Chris Cornutt February 02, 2009 @ 12:58:50
Evert Pot has a quick post on a handy little topic - making streams from strings with PHP (see some of it in action on Davey Shafik's blog).
There are situations where a string instead needs to be used, and for these purposes the data: stream wrapper is used. Initially I thought it was only possible to encode the actual string in base64, which I didn't like because of the added footprint. [...] Quickly checking out the rfc, it turns out that ';base64' can be omitted to just pass along the raw data, which makes a lot more sense in the context of PHP.
His example takes in an example string and pushes it back out the other side after base64 encoding and decoding it. Davey Shafik found a use for it in avoiding an eval call.
voice your opinion now!
stream string tutorial base64 streamgetcontents eval
Davey Shafik's Blog: Avoiding EVAL()
by Chris Cornutt February 02, 2009 @ 11:15:24
Davey Shafik has a helpful hint for avoiding one of the worst functions to use in PHP - eval.
There are a shed-load of ways to "eval()" code without actually calling the eval() function '" usually done simply to avoid the use of the dreaded "evil()" function, but often times because the system has eval() disabled using "disable_functions" in php.ini. Here is another simple way to avoid eval() without writing out files to the filesystem
His example uses the streams wrapper to natively execute the code from a string variable as a data element, base64 decoded. It's more of a proof-of-concept than anything else, but its an interesting solution to a tough problem to solve at times.
voice your opinion now!
eval evil avoid streams wrapper data base64 execute
Zend Developer Zone: Security Tips #10, #11, and #12
by Chris Cornutt March 19, 2007 @ 11:24:00
The Zend Developer Zone has posted three new helpful security tips to add to their growing list - one on mailing, one about working with privileges, and the other on the dangers of eval:
- In tip #10, Cal looks briefly at some of the dangers of blindly using form input when sending a mail. One never knows what kind of nasty headers a user might enter.
- Tip #11 recommends the "path of least privileges" when it comes to allowing access to your application. Don't go global when simple will do just fine - even with the best of intentions, the wrong access can lead to big issues.
- Finally, in tip #12, one of the more discouraged functions in PHP is discussed - eval. This one little function, when fed the wrong kind of string, can unravel your application from the inside out and provide a would-be attacker just the opening they might need.
You can check out more great security tips like these on the Zend Developer Zone website.
voice your opinion now!
securitytip eval mail form filter input privilges securitytip eval mail form filter input privilges
TheDailyWTF.com: Client-Side PHP
by Chris Cornutt April 13, 2006 @ 07:03:29
The Daily WTF post for today bears mentioning if for nothing less than to show how to not do things. It has an interesting twist on the whole Ajax craze that's going on in the web today, and takes it to a really scary, pointless level.
The introduction of the XMLHttpRequest component (*) opened the doorway for a new breed of "fancy schmancy" web applications like Flickr, GMail, etc. This, in turn, spawned an entire sub-industry and a new series of buzzwords seemingly based on the names of household cleaning chemicals. It even incremented the current version of the Internet to 2.0.
That said, it should come as no surprise that this Borax-technology has also empowered "certain programmers" to create new perversions in information technology never imagined before. Gustavo Carvalho discovered what happens when XMLHttpRequest and the Eval() function in PHP are combined. I'll leave it to your immagination as to what the server-side looks like ...
You should definitely check out the code on this one - using evil() is bad enough, but passing code back to the PHP server like that is just wrong (and a huge security hole).
voice your opinion now!
thedailywtf client-side ajax xmlhttprequest eval thedailywtf client-side ajax xmlhttprequest eval
|
Community Events
Don't see your event here? Let us know!
|