Bug 1026763 - Locale::Maketext interpolating escaped backslashes improperly
Summary: Locale::Maketext interpolating escaped backslashes improperly
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-Locale-Maketext
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Petr Pisar
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-05 11:43 UTC by Petr Pisar
Modified: 2014-07-02 13:35 UTC (History)
4 users (show)

Fixed In Version: perl-Locale-Maketext-1.23-293.fc21
Clone Of: 1025906
: 1028949 (view as bug list)
Environment:
Last Closed: 2014-07-02 13:35:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
CPAN 120457 0 None None None Never
Red Hat Bugzilla 884354 0 medium CLOSED CVE-2012-6329 perl: possible arbitrary code execution via Locale::Maketext 2021-10-25 08:56:54 UTC

Internal Links: 884354

Description Petr Pisar 2013-11-05 11:43:44 UTC
+++ This bug was initially created as a clone of Bug #1025906 +++

Description of problem:
When a literal backslash is in an L10N value, it is treated nonuniformly by the Locale::Maketext::_compile method, as patched by RH in Locale::Maketext::Guts (per https://bugzilla.redhat.com/show_bug.cgi?id=884354).  The result depends on unrelated parts of the string.

[...]

How reproducible:
Always

Steps to Reproduce:
1. Create a language token, whose value is 'Some data\n'
2. Query the language token through Locale::Maketext ($lh->maketext($tag))

Actual results:
'Some data\\n'

Expected results:
'Some data\n'

Additional info:

The behavior changes in the following cases:
1) If the value contains a tokenized field, behavior depends on whether there is a trailing newline:

'[_1]Some data\n' => 'Some data\n'
'[_1]Some data\n'."\n" => 'Some data\\n
'
2) If the escaped backslash is in a function call, it behaves as expected:

'Some data[sprintf,\n]' => 'Some data\n'



NOTE: All of these cases in standard perl (with Locale::Maketext v 1.13 from CPAN) behave exactly the same as each other, and they all produce just a single '\' before the 'n'.


--- Additional comment from Petr Pisar on 2013-11-04 12:16:19 GMT ---

The 'Some data\n' is due to back-porting the fix to perl 5.10.1.

The parameterized case behaves for me differently and is caused by the changes in the fix. Even latest Locale::Maketext is affected.
----

All Fedoras are affected.

Comment 1 Fedora Update System 2013-11-11 10:19:51 UTC
perl-Locale-Maketext-1.23-293.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/perl-Locale-Maketext-1.23-293.fc20

Comment 2 Fedora Update System 2014-01-03 08:35:36 UTC
perl-Locale-Maketext-1.23-293.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.