Description
Encode.pm, as distributed in Perl through 5.34.0, allows local users to gain privileges via a Trojan horse Encode::ConfigLocal library (in the current working directory) that preempts dynamic module loading. Exploitation requires an unusual configuration, and certain 2021 versions of Encode.pm (3.05 through 3.11). This issue occurs because the || operator evaluates @INC in a scalar context, and thus @INC has only an integer value.
Fixed in Linux distributions
Distributions backport fixes, so the version that fixes this vulnerability differs per release — upgrade to at least the version shown. From the distributions' security trackers and advisories.
Debian
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Debian 14 | libencode-perl | 3.08-2 | — |
| Debian 14 | perl | 5.32.1-5 | — |
| Debian 13 | libencode-perl | 3.08-2 | — |
| Debian 13 | perl | 5.32.1-5 | — |
| Debian 12 | libencode-perl | 3.08-2 | — |
| Debian 12 | perl | 5.32.1-5 | — |
Ubuntu
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 26.10 | libencode-perl | No fix yet | — |
| Ubuntu 26.04 LTS | libencode-perl | No fix yet | — |
| Ubuntu 25.10 | libencode-perl | No fix yet | — |
| Ubuntu 24.04 LTS | libencode-perl | No fix yet | — |
| Ubuntu 22.04 LTS | libencode-perl | No fix yet | — |
| Ubuntu 22.04 LTS | perl | 5.32.1-3ubuntu3 | — |
Show 1 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Ubuntu 16.04 LTS | libencode-perl | No fix yet | — |
Alpine
Security tracker ↗| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.24 | perl | 5.34.0-r1 | — |
| Alpine v3.24 | perl-encode | 3.12-r0 | — |
| Alpine v3.23 | perl | 5.34.0-r1 | — |
| Alpine v3.23 | perl-encode | 3.12-r0 | — |
| Alpine v3.22 | perl | 5.34.0-r1 | — |
| Alpine v3.22 | perl-encode | 3.12-r0 | — |
| Alpine v3.21 | perl | 5.34.0-r1 | — |
| Alpine v3.21 | perl-encode | 3.12-r0 | — |
| Alpine v3.20 | perl | 5.34.0-r1 | — |
| Alpine v3.20 | perl-encode | 3.12-r0 | — |
Show 5 more (older releases, extended support, other products)Fewer releases
| Release | Package | Fixed in | Advisory |
|---|---|---|---|
| Alpine v3.19 | perl | 5.34.0-r1 | — |
| Alpine v3.19 | perl-encode | 3.12-r0 | — |
| Alpine v3.18 | perl | 5.34.0-r1 | — |
| Alpine v3.18 | perl-encode | 3.12-r0 | — |
| Alpine v3.17 | perl | 5.34.0-r1 | — |
| Alpine v3.17 | perl-encode | 3.12-r0 | — |
| Alpine v3.16 | perl | 5.34.0-r1 | — |
| Alpine v3.16 | perl-encode | 3.12-r0 | — |
| Alpine v3.15 | perl | 5.34.0-r1 | — |
| Alpine v3.15 | perl-encode | 3.12-r0 | — |
Advisories 3
- WID-SEC-2024-3476 Perl: Schwachstelle ermöglicht Codeausführung BSI CERT-Bund (WID) · Sep 16, 2026
- WID-SEC-2024-0874 Oracle Enterprise Manager: Mehrere Schwachstellen BSI CERT-Bund (WID) · Apr 16, 2024
- WID-SEC-2023-0132 Oracle Fusion Middleware: Mehrere Schwachstellen BSI CERT-Bund (WID) · May 1, 2023
References
- https://metacpan.org/dist/Encode/changes
- https://security-tracker.debian.org/tracker/CVE-2021-36770
- https://github.com/dankogai/p5-encode/commit/527e482dc70b035d0df4f8c77a00d81f8d775c74
- https://github.com/Perl/perl5/commit/c1a937fef07c061600a0078f4cb53fe9c2136bb9
- https://news.cpanel.com/unscheduled-tsr-10-august-2021/
- FEDORA-2021-92e07de1dd vendor-advisory
- FEDORA-2021-44c65203cc vendor-advisory
- https://security.netapp.com/advisory/ntap-20210909-0003/