View Issue Details

IDProjectCategoryView StatusLast Update
0010710mantisbtsecuritypublic2009-10-07 14:19
Reporterdhx Assigned Tojreese  
PrioritynormalSeverityminorReproducibilityN/A
Status closedResolutionfixed 
Product Version1.2.0rc2 
Target Version1.2.0rc2Fixed in Version1.2.0rc2 
Summary0010710: Improve form token lookup performance beyond O(n)
Description

Currently when validating form tokens we look through every single token stored in a user's session. This is a slow O(n) operation that can be sped up drastically by using an associate array of tokens instead. This also allows token purging to be performed in constant time.

TagsNo tags attached.

Activities

There are no notes attached to this issue.

Related Changesets

MantisBT: master-1.2.x f4e05d1c

2009-07-01 14:32

jreese

Committer: dhx


Details Diff
Form security validation and purge performance

Rather than iterate through all form security tokens to validate and
purge tokens given to a page, partition the token data structure into
blocks by date, and use the token itself as the key. This allows for
constant-time lookups, as well as more performant purges of old token
data by purging entire days in one step.

Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
Affected Issues
0010710
mod - core/form_api.php Diff File

MantisBT: master df7987b0

2009-07-01 14:32

jreese

Committer: dhx


Details Diff
Form security validation and purge performance

Rather than iterate through all form security tokens to validate and
purge tokens given to a page, partition the token data structure into
blocks by date, and use the token itself as the key. This allows for
constant-time lookups, as well as more performant purges of old token
data by purging entire days in one step.

Signed-off-by: David Hicks <hickseydr@optusnet.com.au>
Affected Issues
0010710
mod - core/form_api.php Diff File