http://code.google.com/p/tipfy/source/browse/tipfyext/wtform...
742 karma · joined October 23, 2009
http://code.google.com/p/tipfy/source/browse/tipfyext/wtform...
In their eyes, hacking is exploiting a weakness in a system to do something the system was not originally intended or designed to do.
But in the end, nobody cares.
Besides, don't use GET for non-idempotent requests (those which change state). That's just webapp development 101.
Edited for clarity.
Trust me, as they each grow older, they will appreciate your cooking more and more. I myself was a hamburgers, hotdogs, chicken nuggets and macaroni and cheese kid growing up, but going home to my parents to eat Mom's cooking is priceless now.
By the way... I see people all too often misunderstand "cheat days". On a cheat day, you don't get to pig out on junk food. You get to pig out on good, healthy food (i.e., double-up on serving sizes), or have just a serving of less-than healthy food (such as pizza, etc).
Don't ever allow the client to specify a filename; use an indirect reference such as a uuid. If you must, always perform path normalization and/or only allow alphanumeric characters.
def known_edits2(word):
L = []
for e1 in edits1(word):
for e2 in edits1(e1):
if e2 in NWORDS:
L.append(e2)
return set(L)Now let's say you had to only create a link as I proposed. The length of the "secure" token can be as long as you want! Because the URL is not entered manually, you don't have to worry about being so "user-friendly" (as long as your url doesn't break in mail clients..)
If you fed a secure PRNG to an HMAC-SHA256/512 hash or a UUID... These values would be much, MUCH harder to guess than any password you could generate for your user. As a result, the following is not true:
> They could "guess" the reset key just as easy as they could "guess" the new generated password.
You bring up a good point about the password delivery over cleartext (though HN doesn't use SSL anyway, I didn't consider it at the time of posting). On a side note, does HN even have account lockout?
* Note that even my proposed solution is not the best way to handle password resets. Trust me on this, I've seen way too many applications do this wrong which have resulted in ability to compromise arbitrary users' accounts.
import bcrypt
hashed = bcrypt.hashpw(password, bcrypt.gensalt(log_rounds=13))
Increasing log_rounds by one increases the work factor exponentially (2 * * log_rounds).edit: The only difference is in how fast you manage to recover.
Anyway, your nginx/lighttpd server is more likely to be exploited and compromised via an actual vulnerability rather than your Apache server via a slowloris-style attack. It's akin to putting a wide receiver in front of your runningbacks...
I was grinding down a box with a decline which was about 3.5 feet off the ground. I had lost my balance, and instead of putting my right foot down on top of the box, I put my left foot down, 3.5 feet, onto the sloping decline. After recovering from my fall, I twisted my foot 180 degrees back into the "normal" position. Not thinking clearly at the time, I didn't even realize what had just happened. I got up, walked over to my bike and got back on, only to fall off within a few moments. At that moment, I felt my leg (which still was in my shin guard) and I felt it wobble/seasaw up and down in the middle. Right then, I knew something was wrong.
I broke my tibia, fibula and ankle all in one go. After surgery, I ended up with 2 pins in my ankle, a plate and 5 screws in my tibia and was on crutches for 4 months (these were removed a year after). To this day haven't ridden BMX, though I can ride mountain bikes and snowboard better than I had before. I cringe with agony anytime I see someone take a gnarly spill, remembering the pain I had once experienced.