Skip to content

Commit

Permalink
Warn and reject if a nonce is rapidly reused
Browse files Browse the repository at this point in the history
  • Loading branch information
Rosuav committed Dec 10, 2024
1 parent 2808471 commit a832651
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/http/chan_form.pike
Original file line number Diff line number Diff line change
Expand Up @@ -352,6 +352,10 @@ __async__ mapping(string:mixed) http_request(Protocols.HTTP.Server.Request req)
if (!resp[formid]) resp[formid] = ([]);
if (mapping p = resp[formid]->permissions[?nonce]) {
//The permission is no longer available.
if (p->used) {
werror("FORM REUSED %O\n", nonce);
return; //Silently ignore the second one (for now)
}
p->used = 1;
}
resp[formid]->responses += ({response});
Expand Down

0 comments on commit a832651

Please sign in to comment.