symfony/symfony-docs — Issue #852: Bug in cookbook article about WSSE
Author: matthiasnoback
Created: 2011-11-14 08:37:53+00:00
State: open

It says:

if (file_exists($this->cacheDir.'/'.$nonce) && file_get_contents($this->cacheDir.'/'.$nonce) + 300 >= time()) {

But the comparison should be "<" since the contents of the file contain a timestamp for the first usage of the nonce, then, when the lifetime gets added to this timestamp, and the resulting timestamp is in the past (i.e. is *less* than time()), the nonce is expired. Only then an exception should be thrown.