Skip Menu |

This queue is for tickets about the GD-SecurityImage-AC CPAN distribution.

Report information
The Basics
Id: 29934
Status: resolved
Worked: 2 hours (120 min)
Priority: 0/
Queue: GD-SecurityImage-AC

People
Owner: SNOWHARE [...] cpan.org
Requestors: devilcrayon [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: (no value)



Subject: path to make GD::SecurityImage::AC taint-safe(r)
When running with taint checking enabled, GD::SecurityImage::AC is killed when attempting to unlink old image files in sub _unlink() line 99. changing the body of the subroutine to this will allow it to pass taint checking: sub _unlink { my $file = shift or return; if (-e $file && !-d _) { if ($file =~ /(^[\w\+_\040\#\(\)\{\}\[\]\/\-\^,\.:;&%@\\~]+\$?$)/ ) { $file = $1; return unlink($file); } else { die "Filename $file unsafe to unlink"; } } return 1; # resume on unexistent file } Perhaps a better RE could be used to check the filename. I stole the one in here from CGI::Untaint::Filename. Thanks! Devin
Resolved as part of 1.11 release.