ext/ftp: cryptic error on servers that don't support TLS session resumption on data connection
Maintainer antworten meist innerhalb von 1 Tag
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 52/100
- Issue-Typ
- Bug
- Klarheit
- Größtenteils klar
- Aktivitätsstatus
- Aktiv
- Tech-Stack
- c
- Bereich
- networking, security
Rechercherichtung
Beginne in ext/ftp am Pfad der Datenverbindung von ftp_nlist und beim data_accept-Fehler, der den TLS-Sitzungsfehler meldet. Reproduziere das Problem mit dem Beispiel für PHP 8.5.9 und untersuche, wie die Warnung gebildet wird; abgeschlossen ist die Arbeit, wenn Benutzer eine klare Erklärung erhalten, dass die Wiederaufnahme der TLS-Sitzung nicht unterstützt wird, ohne dass unsicher fortgefahren wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
Description
The following code:
<?php
$conn_id = ftp_ssl_connect($url);
$login_result = ftp_login($conn_id, $un, $pw);
ftp_set_option($conn_id, FTP_USEPASVADDRESS, false);
ftp_pasv($conn_id, true);
if (!$login_result) {
die("can't login\n");
}
else{
echo "logged in success\n";
$buff = ftp_nlist($conn_id,'outbound');
var_dump($buff);
}
Resulted in this output:
logged in success
Warning: ftp_nlist: data_accept: failed to retrieve the existing SSL session
But I expected this output instead:
logged in success
[nlist output]
TLS session resumption on the data connection is required for it to be secure. GH-12851 fixed that. However, some servers don't seem to support TLS session resumption. In this case, PHP seems to fail with a cryptic-to-the-user error message. However, other FTP clients like i.e. FileZilla will prompt the user with a message like:
This server does not support TLS session resumption on the data connection.
TLS session resumption on the data connection is an important security feature to protect against data connection stealing attacks.
If you continue, transferred files may be intercepted or their contents replaced by an attacker.
I don't know if we want to support opting out of the behaviour (and certainly not continue insecurely silently), but we should definitely provide a better warning here, so users know what's wrong and what to blame.
A user reached out to me for support because this was "working" in PHP 8.1 (insecurely. probably) but stopped working when they upgraded to PHP 8.5, and thought it was a PHP issue. They did try it under 8.2.12 (last version XAMPP shipped) and that worked, and that was prior to when that PR was merged. I'm asking the user to bisect 8.2.13 vs. 8.2.14 to confirm.
As for the problematic FTP server in question, it seems to be Axway SecureTransport as installed by a large logistics company. A little hard to test for ourselves, and a little hard to get them to fix it. I don't know if we can force i.e. vsftpd to disallow session resumption to test it.
PHP Version
PHP 8.5.9
Operating System
Windows Server 2019
- Vorherrschende Sprache
- C
- Sterne
- 40.4k
- Forks
- 8.2k
- Ø Merge
- 2 T. 17 Std.
- Gemergte PRs (30 T.)
- 115
Entwicklungsumgebung
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus php/php-src
-
Bug Status: Needs Triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag
-
Bug Status: Needs Triage
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
Maintainer antworten meist innerhalb von 1 Tag
-
Bug Status: Needs Triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
Maintainer antworten meist innerhalb von 1 Tag
-
Flaky hrtime.phpt testOffenBug Category: Tests Status: Verified
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 1 Tag
-
Bug SAPI: fpm Status: Needs Triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 65/100
php/php-src#21740 · 1 Reaktion ·
Maintainer antworten meist innerhalb von 1 Tag
Ähnliche Issues
-
area:lint-tooling bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
InauguralSystems/EigenScript#1340 ·
Maintainer antworten meist innerhalb von 1 Tag
-
[Bug]: chunk_span_bounds and _validated_chunk_spans reject Pydantic models ChunkSpan and AudioFileOffen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
BasedHardware/omi#19047 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
obsproject/obs-studio#13936 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag
-
category:port-update
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
Maintainer antworten meist innerhalb von 1 Tag