CVE-2024-51755: Unguarded calls to __isset() and to array-accesses when the sandbox is enabled

Published Nov 6, 2024
·
Updated

Description

In a sandbox, and attacker can access attributes of Array-like objects as they were not checked by the security policy. They are now checked via the property policy and the isset() method is now called after the security check. This is a BC break.

Resolution

The sandbox mode now ensures access to array-like's properties is allowed.

The patch for this issue is available here for the 3.11.x branch, and here for the 3.x branch.

Credits

We would like to thank Jamie Schouten for reporting the issue and Nicolas Grekas for providing the fix.

Other sources

Twig is a template language for PHP. In a sandbox, an attacker can access attributes of Array-like objects as they were not checked by the security policy. They are now checked via the property policy and the isset() method is now called after the security check. This is a BC break. This issue has been patched in versions 3.11.2 and 3.14.1. All users are advised to upgrade. There are no known workarounds for this issue.

— NVD

Unguarded calls to isset() and to array-accesses when the sandbox is enabled

— Packagist

Affected Software

11 affected componentsFixes available
composer/twig/twig>=3.12<3.14.1
3.14.1
composer/twig/twig<3.11.2
3.11.2
composer/twig/twig>=1.0.0, <2.0.0
composer/twig/twig>=2.0.0, <3.0.0
composer/twig/twig>=3.0.0, <3.11.2
3.11.2
composer/twig/twig>=3.12.0, <3.14.1
3.14.1
debian/php-twig*
debian/php-twig<3.14.2-1
3.14.2-1
debian/php-twig<3.14.2-1
3.14.2-1
debian/php-twig<=3.5.1-1+deb12u3
3.27.0-0+deb13u13.30.0-1
IBM API Connect V12 OnPrem<=v12.1.0.0 - v12.1.1.2

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade composer/twig/twig to a version that resolves this vulnerability.

    Fixed in 3.14.1
  2. Upgrade

    Upgrade composer/twig/twig to a version that resolves this vulnerability.

    Fixed in 3.11.2
  3. Upgrade

    Upgrade debian/php-twig to a version that resolves this vulnerability.

    Fixed in 3.14.2-1
  4. Upgrade

    Upgrade debian/php-twig to a version that resolves this vulnerability.

    Fixed in 3.27.0-0+deb13u1Fixed in 3.30.0-1
  5. Upgrade

    Upgrade Twig to a version that resolves this vulnerability.

    Fixed in 3.11.2
  6. Upgrade

    Upgrade Twig to a version that resolves this vulnerability.

    Fixed in 3.14.1

Event History

Nov 6, 2024
Advisory Published
via Packagist·08:00 AM
Data Sourced
via Packagist·08:00 AM
DescriptionSeverityAffected Software
CVE Published
via MITRE·07:27 PM
Data Sourced
via MITRE·07:27 PM
DescriptionSeverityWeakness
Advisory Published
via GitHub·07:52 PM
Data Sourced
via NVD·08:15 PM
DescriptionSeverityWeakness
Data Sourced
via OSV·08:15 PM
DescriptionSeverityAffected Software
Oct 8, 2026
Data Sourced
via IBM·12:00 AM
DescriptionAffected Software

Parent advisories

This vulnerability appears in the following advisories.

Frequently Asked Questions

1

What is the severity of CVE-2024-51755?

CVE-2024-51755 has a high severity due to its potential for attackers to bypass security policies.

2

How do I fix CVE-2024-51755?

To fix CVE-2024-51755, update the twig/twig package to version 3.14.1 or 3.11.2.

3

What are the affected versions in CVE-2024-51755?

CVE-2024-51755 affects twig/twig versions between 3.12.0 and 3.14.1 and all versions before 3.11.2.

4

What type of security issue is CVE-2024-51755?

CVE-2024-51755 is a security issue that allows access to Array-like objects without proper validation.

5

Is there a backward compatibility break in CVE-2024-51755?

Yes, CVE-2024-51755 introduces a backward compatibility break due to changes in the security checks.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203