Originally posted by: kamper
I'm not familiar with asp, maybe someone could comment on the race condition possibility there. So if you had: (this is pseudo-code, I don't know asp, as I said)
if (submitted) {
..reject submission;
} else {
..submitted = true;
..continue with page;
}
And you obviously could have two submissions simultaneously detect no previous submission and then both set submitted = true. Granted, it's not highly likely given a session scoped variable, but is there a mechanism to deal with such a thing? Is a single statement even guaranteed to be atomic?
Yes. Like I said, unlikely to be a problem, but I hate leaving holes anywhere 😛 I mean, let's say this form submission involved transfers of large sums of money, and the user knows that by doing it twice he can get that sum again for free. He may maliciously try to submit twice at the same time.Originally posted by: Zugzwang152
i dont understand this... a session should be unique to the user, therefore he would have to be refreshing twice at the same time for this to happen?
Originally posted by: kamper
Yes. Like I said, unlikely to be a problem, but I hate leaving holes anywhere 😛 I mean, let's say this form submission involved transfers of large sums of money, and the user knows that by doing it twice he can get that sum again for free. He may maliciously try to submit twice at the same time.Originally posted by: Zugzwang152
i dont understand this... a session should be unique to the user, therefore he would have to be refreshing twice at the same time for this to happen?
I'm not at all thinking about average joe, staring at IE and playing by the rules. I'm thinking about a real cracker who may not even be using a real browser.
I don't give a rip how he did it or how unlikely it was. I care that I have left the hole open and given him the opportunity to exploit it. Relying on chance for your security is dumb.Originally posted by: Zugzwang152
hats off to the guy who can send the second request through the *Internet* and have it get there between the if and the else statements. 😛