Skip to content

Conversation

@depfu
Copy link

@depfu depfu bot commented Oct 11, 2025


Welcome to Depfu 👋

This is one of the first three pull requests with dependency updates we've sent your way. We tried to start with a few easy patch-level updates. Hopefully your tests will pass and you can merge this pull request without too much risk. This should give you an idea how Depfu works in general.

After you merge your first pull request, we'll send you a few more. We'll never open more than seven PRs at the same time so you're not getting overwhelmed with updates.

Let us know if you have any questions. Thanks so much for giving Depfu a try!



🚨 Your current dependencies have known security vulnerabilities 🚨

This dependency update fixes known security vulnerabilities. Please see the details below and assess their impact carefully. We recommend to merge and deploy this as soon as possible!


Here is everything you need to know about this upgrade. Please take a good look at what changed and the test results before merging this pull request.

What changed?

✳️ phpoffice/phpspreadsheet (4.4.0 → 5.1.0) · Repo · Changelog

Security Advisories 🚨

🚨 PhpSpreadsheet vulnerable to SSRF when reading and displaying a processed HTML document in the browser

Product: PhpSpreadsheet
Version: 3.8.0
CWE-ID: CWE-918: Server-Side Request Forgery (SSRF)
CVSS vector v.3.1: 7.5 (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N)
CVSS vector v.4.0: 8.7 (AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N)
Description: SSRF occurs when a processed HTML document is read and displayed in the browser
Impact: Server-Side Request Forgery
Vulnerable component: the PhpOffice\PhpSpreadsheet\Worksheet\Drawing class, setPath method
Exploitation conditions: getting a string from the user that is passed to the HTML reader
Mitigation: improved processing of the $path variable of the setPath method of the PhpOffice\PhpSpreadsheet\Worksheet\Drawing class is needed
Researcher: Aleksey Solovev (Positive Technologies)

Research

The researcher discovered zero-day vulnerability Server-Side Request Forgery (SSRF) (in the setPath method of the PhpOffice\PhpSpreadsheet\Worksheet\Drawing class) in Phpspreadsheet.
The latest version (3.8.0) of the phpoffice/phpspreadsheet library was installed. Below are the details of the installation:

Listing 1. Installing the phpoffice/phpspreadsheet library

$ composer require phpoffice/phpspreadsheet --prefer-source

The code that processes the HTML string with further rendering and displaying the result in the browser.
Listing 2. Executable file index.php using the PhpSpreadsheet library

<?php

require DIR . '/vendor/autoload.php';

$inputFileType = 'Html';
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);

$inputFileName = './doc/file.html';
$spreadsheet = $reader->load($inputFileName);

$writer = new \PhpOffice\PhpSpreadsheet\Writer\Html($spreadsheet);
print($writer->generateHTMLAll());

Also, the ./doc/file.html has the following content: the img tag with the src attribute, which contains the value http:// 127.0.0.1:1337

Listing 3. The ./doc/file.html file

<table>
    <tr>
        <img src="http://127.0.0.1:1337">
    </tr>
</table>

The vulnerability lies in the setPath method of the PhpOffice\PhpSpreadsheet\Worksheet\Drawing class.

Figure 1. The PhpOffice\PhpSpreadsheet\Worksheet\Drawing class, setPath method.

fig1

Figure 2 below demonstrates the SSRF vulnerability exploitation.

fig2

Figure 2. Demonstration of the SSRF vulnerability exploitation

Also, there is code on line 154 that could potentially be used by an attacker to perform unsafe deserialization via the phar archive and the file_exists method.

Figure 3. Opportunity to perform phar deserialization
fig3


Please, assign all credits to: Aleksey Solovev (Positive Technologies)

Credit

Aleksey Solovev (Positive Technologies)

Release Notes

5.1.0

Added

Fixed

5.0.0

Breaking Changes

  • Images will be loaded from an external source (e.g. http://example.com/img.png) only if the reader is explicitly set to allow it via $reader->setAllowExternalImages(true). We do not believe that loading of external images is a widely used feature.
  • Deletion of items deprecated in Release 4. See "removed" below.
  • Move some properties from Base Reader to Html Reader. PR #4551
  • DefaultValueBinder will treat integers with more than 15 digits as strings. Issue #4522 PR #4527

Removed

  • Theme public constants COLOR_SCHEME_2013_PLUS_NAME (use COLOR_SCHEME_2013_2022_NAME) and COLOR_SCHEME_2013_PLUS (use COLOR_SCHEME_2013_2022).

Fixed

4.5.0

Added

  • Add to all readers the option to allow or forbid fetching external images. This is unconditionally allowed now. The default will be set to "allow", so no code changes are necessary. However, we are giving consideration to changing the default. PR #4543
  • Address Excel Inappropriate Number Format Substitution. PR #4532

Fixed

Does any of this look wrong? Please let us know.

Commits

See the full diff on Github. The new version differs by more commits than we can show here.


Depfu Status

Depfu will automatically keep this PR conflict-free, as long as you don't add any commits to this branch yourself. You can also trigger a rebase manually by commenting with @depfu rebase.

All Depfu comment commands
@​depfu rebase
Rebases against your default branch and redoes this update
@​depfu recreate
Recreates this PR, overwriting any edits that you've made to it
@​depfu merge
Merges this PR once your tests are passing and conflicts are resolved
@​depfu cancel merge
Cancels automatic merging of this PR
@​depfu close
Closes this PR and deletes the branch
@​depfu reopen
Restores the branch and reopens this PR (if it's closed)
@​depfu pause
Ignores all future updates for this dependency and closes this PR
@​depfu pause [minor|major]
Ignores all future minor/major updates for this dependency and closes this PR
@​depfu resume
Future versions of this dependency will create PRs again (leaves this PR as is)

@depfu depfu bot added the depfu label Oct 11, 2025
@coderabbitai
Copy link

coderabbitai bot commented Oct 11, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant