This is an automated email from the ASF dual-hosted git repository.

tomaswolf pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mina-sshd.git

commit e0eff0d634cef571b2f16827d6eb22f618d8814b
Author: Thomas Wolf <[email protected]>
AuthorDate: Fri Oct 23 16:46:45 2026 +0200

    Limit remote window packet size better
    
    Apache MINA SSHD already included a range check for the remote window's
    packet size. But the default settings allowed values up to 2**29, which
    is still uncomfortable high and easily can lead to OOM situations if the
    value is used to allocate a buffer.
    
    Change the default limit to 256kB.
---
 .../src/main/java/org/apache/sshd/core/CoreModuleProperties.java      | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/sshd-core/src/main/java/org/apache/sshd/core/CoreModuleProperties.java 
b/sshd-core/src/main/java/org/apache/sshd/core/CoreModuleProperties.java
index 864795a64..68ef1d3f3 100644
--- a/sshd-core/src/main/java/org/apache/sshd/core/CoreModuleProperties.java
+++ b/sshd-core/src/main/java/org/apache/sshd/core/CoreModuleProperties.java
@@ -293,14 +293,14 @@ public final class CoreModuleProperties {
     public static final Property<Duration> 
BUFFERED_IO_OUTPUT_MAX_PENDING_WRITE_WAIT
             = Property.duration("buffered-io-output-max-pending-write-wait", 
Duration.ofSeconds(30L));
 
-    public static final long DEFAULT_MAX_PACKET_SIZE = 0x8000L;
+    public static final long DEFAULT_MAX_PACKET_SIZE = 
SshConstants.SSH_REQUIRED_PAYLOAD_PACKET_LENGTH_SUPPORT;
     /**
      * Key used to retrieve the value of the maximum packet size in the 
configuration properties map.
      */
     public static final Property<Long> MAX_PACKET_SIZE
             = Property.long_("packet-size", DEFAULT_MAX_PACKET_SIZE);
 
-    public static final long DEFAULT_LIMIT_PACKET_SIZE = Integer.MAX_VALUE / 
4L;
+    public static final long DEFAULT_LIMIT_PACKET_SIZE = 8 * 
DEFAULT_MAX_PACKET_SIZE;
     /**
      * A safety value that is designed to avoid an attack that uses large 
channel packet sizes
      */

Reply via email to