Deprecate unsafe API

This commit is contained in:
vladvildanov
2026-09-01 11:43:05 +03:00
parent f9c3d6b479
commit e172c9fa8d
3 changed files with 15 additions and 0 deletions
+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] !== '*') {