Deprecated CommandInterface::deserializeCommand() (CVE GHSA-w6f5-v2h6-g786)

This commit is contained in:
vladvildanov
2026-09-11 12:38:18 +03:00
parent 401abc4315
commit fccc44d845
4 changed files with 16 additions and 0 deletions
+1
View File
@@ -3,6 +3,7 @@
## Unreleased
### Added
### Changed
- Deprecated `CommandInterface::deserializeCommand()` (CVE GHSA-w6f5-v2h6-g786)
### Fixed
- Fixed RESP3 double parsing returning positive `INF` for `-inf` payloads (#1716)
- Fixed `client_info` connection parameter being ignored (#1722)
+3
View File
@@ -158,6 +158,9 @@ abstract class Command implements CommandInterface
/**
* {@inheritDoc}
*
* @deprecated Not binary-safe; see CommandInterface::deserializeCommand().
* Scheduled for removal in the next major.
*/
public static function deserializeCommand(string $serializedCommand): CommandInterface
{
+6
View File
@@ -98,6 +98,12 @@ interface CommandInterface
*
* @param string $serializedCommand
* @return static
*
* @deprecated Not binary-safe: it re-parses on "\r\n" and ignores RESP bulk-length
* prefixes, so any argument containing "\r\n" is corrupted, and it
* instantiates a command class from the parsed input. Never call it on
* untrusted or serialized data (see CVE GHSA-w6f5-v2h6-g786). Scheduled
* for removal in the next major.
*/
public static function deserializeCommand(string $serializedCommand): CommandInterface;
}
+6
View File
@@ -153,6 +153,12 @@ final class RawCommand implements CommandInterface
return $buffer;
}
/**
* {@inheritDoc}
*
* @deprecated Not binary-safe; see CommandInterface::deserializeCommand().
* Scheduled for removal in the next major.
*/
public static function deserializeCommand(string $serializedCommand): CommandInterface
{
if ($serializedCommand[0] !== '*') {