You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
XML::Feed::new and XML::Feed::parse build a class name by interpolating their format argument and loading it with a string eval: my $format_class = 'XML::Feed::Format::' . $format; eval "use $format_class". Nothing constrains the name, so a format containing a semicolon has the remainder run as Perl; we confirmed this through both entry points. Both methods document format as an ordinary argument, and choosing a feed format from a query parameter (format=RSS) is a common content-negotiation pattern, so an application can reasonably pass a value it does not fully control.
I suggest the following:
In the BEGIN block in lib/XML/Feed.pm also create a package variable %formatters which maps format names to a true value
Whenever we're passed a string to use as a format name, check %formatters for valid values
Activity