Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security: prevent XXE (XML External Entity) when loading files #4119

Merged
merged 1 commit into from
Jul 29, 2024

Conversation

PowerKiKi
Copy link
Member

Prevent XEE by hiding custom entities by using single quote to declare a non-UTF-8 encoding.

XML standard, https://www.w3.org/TR/xml/#NT-EncodingDecl, allows single quote to declare encoding, but we did not support it. Instead, we incorrectly fell back on the default of UTF-8. That incorrectly kept the XML as non-UTF-8, and thus prevented our regexp-based custom entity detection mechanism to work.

Prevent XEE by hiding custom entities by using single quote to
declare a non-UTF-8 encoding.

XML standard, https://www.w3.org/TR/xml/#NT-EncodingDecl, allows single
quote to declare encoding, but we did not support it. Instead, we
incorrectly fell back on the default of UTF-8. That incorrectly kept the
XML as non-UTF-8, and thus prevented our regexp-based custom entity
detection mechanism to work.
@PowerKiKi PowerKiKi added this pull request to the merge queue Jul 29, 2024
Merged via the queue into master with commit ea97c17 Jul 29, 2024
24 checks passed
@ionmacariatremend
Copy link

Can we add this fix for ^1 version too? For now any deploy will crash for components which are using ^1 version...

acrobat added a commit to acrobat/PhpSpreadsheet that referenced this pull request Aug 30, 2024
acrobat added a commit to acrobat/PhpSpreadsheet that referenced this pull request Aug 30, 2024
@AoiKagase
Copy link

AoiKagase commented Sep 4, 2024

Will there ever be a backport to 2.1.0?
The PHP version that fully supports backporting on RHEL9 is php 8.0.30, and the last version of phpspreadsheet that can be installed with composer is 2.1.0.

@oleibman
Copy link
Collaborator

oleibman commented Sep 5, 2024

@AoiKagase Php8.0 reached end-of-life (no updates, not even for security) almost a year ago. There seems to be a way to install a supported version on RHEL9 here. If that is not possible, might PhpSpreadsheet 1.29.1 meet your needs?

@AoiKagase
Copy link

AoiKagase commented Sep 6, 2024

Although PHP itself is no longer supported, RHEL9 has a 10-year guarantee that security updates to 8.0 will be backported by Redhat.
https://access.redhat.com/support/policy/updates/rhel-app-streams-life-cycle#rhel9_full_life_application_streams

Application Stream | Release Date | Retirement Date | Release
PHP 8.0 | May 2022 | May 2032 | 9.0

Since composer installs 2.1.0 by default, many companies may end up using the vulnerable version.

@ChinhTQ-Vnext
Copy link

Can add fix to apply version php 7.3..#4119 not support for php 7.3

@oleibman
Copy link
Collaborator

oleibman commented Sep 9, 2024

@ChinhTQ-Vnext We are unlikely to act on your request. See discussion in issue #4154, and continue the discussion there if you wish.

@oleibman
Copy link
Collaborator

@AoiKagase I have released 2.1.1 which will handle your situation. Thank you for your explanation.

@AoiKagase
Copy link

@oleibman Thank you. I will update with it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

5 participants