Skip to content

Commit

Permalink
Bug 1309278 - Cache::Memcached::Fast returns tainted data if the key …
Browse files Browse the repository at this point in the history
…is tainted

r=dkl
  • Loading branch information
dylanwh committed Oct 11, 2016
1 parent d328d40 commit d9ba51c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Bugzilla/Memcached.pm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use warnings;

use Bugzilla::Error;
use Scalar::Util qw(blessed);
use Bugzilla::Util qw(trick_taint);
use URI::Escape;

# memcached keys have a maximum length of 250 bytes
Expand Down Expand Up @@ -219,6 +220,7 @@ sub _config_prefix {
sub _encode_key {
my ($self, $key) = @_;
$key = $self->_global_prefix . '.' . uri_escape_utf8($key);
trick_taint($key) if defined $key;
return length($self->{namespace} . $key) > MAX_KEY_LENGTH
? undef
: $key;
Expand Down

0 comments on commit d9ba51c

Please sign in to comment.