Security Advisories (1)
CVE-2026-13048 (2026-08-13)

Data::MuForm::Localizer versions through 0.05 for Perl execute Perl from a message catalog header, reached at an arbitrary path because load_lexicon interpolates the language attribute into the catalog filename. load_lexicon builds the catalog path by appending `Messages/$lang.po` to the directory holding Localizer.pm, where $lang is the language attribute, with no check that it names a bare locale tag. A value holding `../` segments walks out of the message directory, so any readable path with a `.po` suffix is loaded. While parsing the catalog, extract_header_msgstr takes the `Plural-Forms:` header, prefixes `$` to the bare words nplurals, plural and n, and passes the rest verbatim into a string that is evaluated: the nplurals form evaluates the header expression immediately, and the plural_code form compiles it into a subroutine whose body runs when a plural message is localized. A header of `nplurals=2; plural=(system('...'),0);` therefore runs that command as the catalog loads. The evaluation inherits strict, so an expression that assigns to an undeclared variable fails to compile, while one built from calls alone does not. An application that sets the language attribute from request data, an Accept-Language header or a locale parameter, and an attacker who can place a file with a `.po` suffix and chosen contents at a readable path, together give code execution as the application user. The message expansion path is not affected: expand_named substitutes only the placeholder names the caller supplies, and _mangle_value returns the value unchanged.

my $fif = { 'addresses.0.street' => 'First Street', 'addresses.0.city' => 'Prime City', 'addresses.0.country' => 'Utopia', 'addresses.0.id' => '0', 'addresses.0.sector' => '', 'addresses.1.street' => 'Second Street', 'addresses.1.city' => 'Secondary City', 'addresses.1.country' => 'Graustark', 'addresses.1.id' => '1', 'addresses.1.sector' => '', 'addresses.2.street' => 'Third Street', 'addresses.2.city' => 'Tertiary City', 'addresses.2.country' => 'Atlantis', 'addresses.2.id' => '2', 'addresses.2.sector' => '', }; is_deeply( $form->fif, $fif, 'get fill in form'); $fif->{'addresses.0.city'} = 'Primary City'; $fif->{'addresses.2.country'} = 'Grand Fenwick'; delete $fif->{my_test}; $form->clear; $form->process($fif); ok($form->validated, 'validate fif'); $fif->{my_test} = ''; is_deeply( $form->fif, $fif, 'still get right fif'); $init_values->{addresses}->[0]->{city} = 'Primary City'; $init_values->{addresses}->[2]->{country} = 'Grand Fenwick'; is_deeply( $form->values, $init_values, 'still get right values');

$fif = { 'addresses.0.street' => 'First Street', 'addresses.0.city' => 'Prime City', 'addresses.0.country' => 'Utopia', 'addresses.0.id' => '0', 'addresses.0.sector' => undef, 'addresses.2.street' => 'Third Street', 'addresses.2.city' => 'Tertiary City', 'addresses.2.country' => 'Atlantis', 'addresses.2.id' => '2', 'addresses.2.sector' => undef, };

$form->process($fif);

ok( $form->validated, 'form validated' ); is( $form->field('addresses')->num_fields, 2, 'right number of fields');

$fif = { 'addresses.0.street' => 'Main Street', 'addresses.0.city' => 'Prime City', 'addresses.0.country' => 'Utopia', 'addresses.0.id' => '0', 'addresses.0.sector' => undef, };

ok( $form->process($fif), 'process a single repeatable element'); is( $form->field('addresses')->field('0')->field('street')->value, 'Main Street', 'get value'); is( $form->field('addresses')->field('0')->field('sector')->num_options, 3, 'right number of options');

my $values = { 'addresses' => [ { 'city' => 'Prime City', 'country' => 'Utopia', 'id' => 0, 'street' => 'Main Street', 'sector' => undef, }, ], }; is_deeply( $form->values, $values, 'get right values' );

my $no_repeat = { my_test => 'test' }; $form->process( $no_repeat ); is_deeply( $form->value()->{addresses}, [], 'Addresses deleted not in params' );

$form->process( init_values => $init_values ); ok( exists $form->value->{addresses}[0], 'Addresses are back' ); is( $form->field('addresses')->field('0')->field('sector')->num_options, 3, 'right number of options'); $form->clear_init_values; $form->process( { my_test => 'test' } ); is_deeply( $form->value()->{addresses}, [], 'Addresses deleted' );

{ package Test::User::Repeatable; use Moo; use Data::MuForm::Meta; extends 'Data::MuForm';

 has_field 'user_name';
 has_field 'occupation';
 has_field 'employers' => ( type => 'Repeatable' );
 has_field 'employers.employer_id' => ( type => 'PrimaryKey' );
 has_field 'employers.name';
 has_field 'employers.address';
}
$form = Test::User::Repeatable->new;
my $unemployed_params = {
user_name => "No Employer",
occupation => "Unemployed",
'employers.0.employer_id' => '', # empty string
'employers.0.name' => '',
'employers.0.address' => ''
};
$form->process( $unemployed_params);
ok( $form->validated, "User with empty employer validates" );
is_deeply( $form->value, { employers => [], user_name => 'No Employer', occupation => 'Unemployed' },
 'creates right value for empty repeatable' );
is_deeply( $form->fif, $unemployed_params, 'right fif for empty repeatable' );

1 POD Error

The following errors were encountered while parsing the POD:

Around line 76:

Unknown directive: =comment