VYPR
Moderate severityNVD Advisory· Published Oct 10, 2023· Updated Oct 29, 2025

Apache Tomcat: Failure during request clean-up leads to sensitive data leaking to subsequent requests

CVE-2023-42795

Description

Incomplete Cleanup vulnerability in Apache Tomcat.When recycling various internal objects in Apache Tomcat from 11.0.0-M1 through 11.0.0-M11, from 10.1.0-M1 through 10.1.13, from 9.0.0-M1 through 9.0.80 and from 8.5.0 through 8.5.93, an error could cause Tomcat to skip some parts of the recycling process leading to information leaking from the current request/response to the next. Older, EOL versions may also be affected.

Users are recommended to upgrade to version 11.0.0-M12 onwards, 10.1.14 onwards, 9.0.81 onwards or 8.5.94 onwards, which fixes the issue.

AI Insight

LLM-synthesized narrative grounded in this CVE's description and references.

Apache Tomcat's incomplete cleanup of internal objects during recycling can leak request/response data between users, fixed in versions 11.0.0-M12, 10.1.14, 9.0.81, and 8.5.94.

Vulnerability

Overview

Apache Tomcat versions 11.0.0-M1 through 11.0.0-M11, 10.1.0-M1 through 10.1.13, 9.0.0-M1 through 9.0.80, and 8.5.0 through 8.5.93 contain an incomplete cleanup vulnerability in the recycling of internal objects [1][2][3][4]. When an error occurs during the recycle() method of objects like Request and Response, Tomcat may skip parts of the cleanup process, leaving residual data from the current request/response to be reused by the next request [1][2].

Exploitation

Details

An attacker can exploit this by sending requests that trigger errors during recycling, such as failures in deleting temporary files. The recycle() method previously only caught IOException and ignored other exceptions, leading to partial cleanup. The commits address this by catching Throwable and logging the error, as well as ensuring asyncContext is set to null after recycling [1][2][3][4].

Impact

Successful exploitation leads to information leakage from one user's request to another, potentially exposing sensitive data such as parameters, headers, or other request/response content. No authentication is required to trigger the vulnerability.

Mitigation

Users should upgrade to Apache Tomcat 11.0.0-M12, 10.1.14, 9.0.81, or 8.5.94, which contain the fix. No workarounds are available.

AI Insight generated on May 20, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.

Affected packages

Versions sourced from the GitHub Security Advisory.

PackageAffected versionsPatched versions
org.apache.tomcat:tomcat-coyoteMaven
>= 11.0.0-M1, < 11.0.0-M1211.0.0-M12
org.apache.tomcat:tomcat-coyoteMaven
>= 10.1.0-M1, < 10.1.1410.1.14
org.apache.tomcat:tomcatMaven
>= 9.0.0-M1, < 9.0.819.0.81
org.apache.tomcat:tomcatMaven
>= 8.5.0, < 8.5.948.5.94
org.apache.tomcat.embed:tomcat-embed-coreMaven
>= 11.0.0-M1, < 11.0.0-M1211.0.0-M12
org.apache.tomcat.embed:tomcat-embed-coreMaven
>= 10.1.0-M1, < 10.1.1410.1.14
org.apache.tomcat.embed:tomcat-embed-coreMaven
>= 9.0.0-M1, < 9.0.819.0.81
org.apache.tomcat.embed:tomcat-embed-coreMaven
>= 8.5.0, < 8.5.948.5.94

Affected products

35

Patches

4
d6db22e41130

Improve handling of failures during recycle() methods

https://github.com/apache/tomcatMark ThomasOct 5, 2023via ghsa
14 files changed · +52 6
  • java/org/apache/catalina/connector/LocalStrings.properties+1 0 modified
    @@ -50,6 +50,7 @@ coyoteRequest.attributeEvent=Exception thrown by attributes event listener
     coyoteRequest.authenticate.ise=Cannot call authenticate() after the response has been committed
     coyoteRequest.changeSessionId=Cannot change session ID. There is no session associated with this request.
     coyoteRequest.chunkedPostTooLarge=Parameters were not parsed because the size of the posted data was too big. Because this request was a chunked request, it could not be processed further. Use the maxPostSize attribute of the connector to resolve this if the application should accept large POSTs.
    +coyoteRequest.deletePartFailed=Failed to deleted temporary file used for part [{0}]
     coyoteRequest.filterAsyncSupportUnknown=Unable to determine if any filters do not support async processing
     coyoteRequest.getContextPath.ise=Unable to find match between the canonical context path [{0}] and the URI presented by the user agent [{1}]
     coyoteRequest.getInputStream.ise=getReader() has already been called for this request
    
  • java/org/apache/catalina/connector/Request.java+4 3 modified
    @@ -443,8 +443,9 @@ public void recycle() {
                 for (Part part : parts) {
                     try {
                         part.delete();
    -                } catch (IOException ignored) {
    -                    // ApplicationPart.delete() never throws an IOEx
    +                } catch (Throwable t) {
    +                    ExceptionUtils.handleThrowable(t);
    +                    log.warn(sm.getString("coyoteRequest.deletePartFailed", part.getName()), t);
                     }
                 }
                 parts = null;
    @@ -498,8 +499,8 @@ public void recycle() {
             asyncSupported = null;
             if (asyncContext != null) {
                 asyncContext.recycle();
    +            asyncContext = null;
             }
    -        asyncContext = null;
         }
     
     
    
  • java/org/apache/catalina/core/ApplicationHttpRequest.java+7 1 modified
    @@ -44,6 +44,7 @@
     import org.apache.catalina.util.ParameterMap;
     import org.apache.catalina.util.RequestUtil;
     import org.apache.catalina.util.URLEncoder;
    +import org.apache.tomcat.util.ExceptionUtils;
     import org.apache.tomcat.util.buf.B2CConverter;
     import org.apache.tomcat.util.buf.MessageBytes;
     import org.apache.tomcat.util.http.Parameters;
    @@ -600,7 +601,12 @@ public boolean isRequestedSessionIdValid() {
          */
         public void recycle() {
             if (session != null) {
    -            session.endAccess();
    +            try {
    +                session.endAccess();
    +            } catch (Throwable t) {
    +                ExceptionUtils.handleThrowable(t);
    +                context.getLogger().warn(sm.getString("applicationHttpRequest.sessionEndAccessFail"), t);
    +            }
             }
         }
     
    
  • java/org/apache/catalina/core/LocalStrings_cs.properties+2 0 modified
    @@ -24,6 +24,8 @@ applicationDispatcher.specViolation.response=Původní ServletResponse nebo zapo
     
     applicationFilterRegistration.nullInitParams=Není možné nastavit inicializační parametry pro filtr kvůli hodnotě null ve jménu či hodnotě. Jméno [{0}], Hodnota [{1}]
     
    +applicationHttpRequest.sessionEndAccessFail=Výjimka vyvolala ukončení přístupu k session během recykllování dotazu
    +
     aprListener.initializingFIPS=Inicializace FIPS módu...
     
     containerBase.backgroundProcess.cluster=Výjimka při zpracování procesu na pozadí v clusteru [{0}]
    
  • java/org/apache/catalina/core/LocalStrings_es.properties+2 0 modified
    @@ -52,6 +52,8 @@ applicationFilterConfig.jmxUnregisterFail=Ha fallado el desregistro JMX para el
     applicationFilterRegistration.nullInitParam=No puedo poner el parámetro de inicialización para el filtro debido a un nombre nulo y/o valor. Nombre [{0}], Valor [{1}]
     applicationFilterRegistration.nullInitParams=No puedo poner los parámetros de inicialización para el filtro debido a un nombre nulo y/o valor. Nombre [{0}], Valor [{1}]
     
    +applicationHttpRequest.sessionEndAccessFail=Excepción disparada acabando acceso a sesión mientras se reciclaba el requerimiento
    +
     applicationServletRegistration.setServletSecurity.iae=Se ha especificado restricción Null para el servlet [{0}] desplegado en el contexto con el nombre [{1}]
     applicationServletRegistration.setServletSecurity.ise=No se pueden añadir restricciones de seguridad al servlet [{0}] desplegado en el contexto con el nombre [{1}] ya que el contexto ya ha sido inicializado.
     
    
  • java/org/apache/catalina/core/LocalStrings_fr.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=Impossible de fixer le paramètre d'
     applicationFilterRegistration.nullInitParams=Impossible de fixer les paramètres d''initialisation du filtre, à cause d''un nom ou d''une valeur nulle, nom [{0}], valeur [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=Le fragment dans le chemin de dispatch [{0}] a été enlevé
    +applicationHttpRequest.sessionEndAccessFail=Exception lancée durant l'arrêt de l'accès à la session durant le recyclage de la requête
     
     applicationServletRegistration.setServletSecurity.iae=Contrainte nulle spécifiée pour le Servlet [{0}] déployé dans le contexte avec le nom [{1}]
     applicationServletRegistration.setServletSecurity.ise=Les contraintes de sécurité ne peuvent pas être ajoutées au Servlet [{0}] déployé dans le contexte [{1}] car le contexte a déjà été initialisé
    
  • java/org/apache/catalina/core/LocalStrings_ja.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=NULLの名前や値のためにフ
     applicationFilterRegistration.nullInitParams=キー [{0}] または値 [{1}] のいずれかが null のためフィルターの初期化パラメータを設定できません。
     
     applicationHttpRequest.fragmentInDispatchPath=ディスパッチパス [{0}] 中のフラグメントは除去されました
    +applicationHttpRequest.sessionEndAccessFail=リクエストの再利用中に行ったセッションへのアクセス終了処理で例外が送出されました。
     
     applicationServletRegistration.setServletSecurity.iae=サーブレット [{0}] に指定されたNULL制約が、名前 [{1}] のコンテキストに配備されました
     applicationServletRegistration.setServletSecurity.ise=コンテキストが既に初期化されているため、名前 [{1}] のコンテキストに配備されたサーブレット [{0}] にセキュリティ制約を追加できません
    
  • java/org/apache/catalina/core/LocalStrings_ko.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=이름 또는 값 또는 둘 다 널
     applicationFilterRegistration.nullInitParams=널인 이름 또는 값 때문에, 필터의 초기화 파라미터를 설정할 수 없습니다. 이름: [{0}], 값: [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=디스패치 경로 [{0}](으)로부터 URI fragment를 제거했습니다.
    +applicationHttpRequest.sessionEndAccessFail=요청을 참조 해제하는 과정에서, 세션에 대한 접근을 종료시키려 개시하는 중 예외 발생
     
     applicationServletRegistration.setServletSecurity.iae=[{1}](이)라는 이름의 컨텍스트에 배치된 서블릿 [{0}]을(를) 위해, 널 constraint가 지정되었습니다.
     applicationServletRegistration.setServletSecurity.ise=컨텍스트가 이미 초기화되었기에, [{1}](이)라는 이름의 컨텍스트에 배치된 서블릿 [{0}]에 security constraint들이 추가될 수 없습니다.
    
  • java/org/apache/catalina/core/LocalStrings.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=Unable to set initialisation paramet
     applicationFilterRegistration.nullInitParams=Unable to set initialisation parameters for filter due to null name and/or value. Name [{0}], Value [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=The fragment in dispatch path [{0}] has been removed
    +applicationHttpRequest.sessionEndAccessFail=Exception triggered ending access to session while recycling request
     
     applicationServletRegistration.setServletSecurity.iae=Null constraint specified for servlet [{0}] deployed to context with name [{1}]
     applicationServletRegistration.setServletSecurity.ise=Security constraints can''t be added to servlet [{0}] deployed to context with name [{1}] as the context has already been initialised
    
  • java/org/apache/catalina/core/LocalStrings_zh_CN.properties+1 0 modified
    @@ -60,6 +60,7 @@ applicationFilterRegistration.nullInitParam=由于名称和/或值为空,无
     applicationFilterRegistration.nullInitParams=由于name和(或)value为null,无法为过滤器设置初始化参数。name为 [{0}],value为 [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=调度路径[{0}]中的片段已被删除
    +applicationHttpRequest.sessionEndAccessFail=在回收请求时,异常触发了对会话的结束访问。
     
     applicationServletRegistration.setServletSecurity.iae=为部署到名为[{1}]的上下文的Servlet[{0}]指定的空约束
     applicationServletRegistration.setServletSecurity.ise=无法将安全性约束添加到已部署到名称为[{1}]的上下文的servlet [{0}]中,因为上下文已被初始化
    
  • java/org/apache/tomcat/util/buf/B2CConverter.java+10 1 modified
    @@ -26,13 +26,17 @@
     import java.nio.charset.CodingErrorAction;
     import java.util.Locale;
     
    +import org.apache.juli.logging.Log;
    +import org.apache.juli.logging.LogFactory;
    +import org.apache.tomcat.util.ExceptionUtils;
     import org.apache.tomcat.util.res.StringManager;
     
     /**
      * NIO based character decoder.
      */
     public class B2CConverter {
     
    +    private static final Log log = LogFactory.getLog(B2CConverter.class);
         private static final StringManager sm = StringManager.getManager(B2CConverter.class);
     
         private static final CharsetCache charsetCache = new CharsetCache();
    @@ -96,7 +100,12 @@ public B2CConverter(Charset charset, boolean replaceOnError) {
          * Reset the decoder state.
          */
         public void recycle() {
    -        decoder.reset();
    +        try {
    +            decoder.reset();
    +        } catch (Throwable t) {
    +            ExceptionUtils.handleThrowable(t);
    +            log.warn(sm.getString("b2cConverter.decoderResetFail", decoder.charset()), t);
    +        }
             leftovers.position(0);
         }
     
    
  • java/org/apache/tomcat/util/buf/C2BConverter.java+14 1 modified
    @@ -24,11 +24,19 @@
     import java.nio.charset.CoderResult;
     import java.nio.charset.CodingErrorAction;
     
    +import org.apache.juli.logging.Log;
    +import org.apache.juli.logging.LogFactory;
    +import org.apache.tomcat.util.ExceptionUtils;
    +import org.apache.tomcat.util.res.StringManager;
    +
     /**
      * NIO based character encoder.
      */
     public final class C2BConverter {
     
    +    private static final Log log = LogFactory.getLog(C2BConverter.class);
    +    private static final StringManager sm = StringManager.getManager(C2BConverter.class);
    +
         private final CharsetEncoder encoder;
         private ByteBuffer bb = null;
         private CharBuffer cb = null;
    @@ -49,7 +57,12 @@ public C2BConverter(Charset charset) {
          * Reset the encoder state.
          */
         public void recycle() {
    -        encoder.reset();
    +        try {
    +            encoder.reset();
    +        } catch (Throwable t) {
    +            ExceptionUtils.handleThrowable(t);
    +            log.warn(sm.getString("c2bConverter.decoderResetFail", encoder.charset()), t);
    +        }
             leftovers.position(0);
         }
     
    
  • java/org/apache/tomcat/util/buf/LocalStrings.properties+3 0 modified
    @@ -16,10 +16,13 @@
     asn1Parser.lengthInvalid=Invalid length [{0}] bytes reported when the input data length is [{1}] bytes
     asn1Parser.tagMismatch=Expected to find value [{0}] but found value [{1}]
     
    +b2cConverter.decoderResetFail=Failed to reset instance of decoder for character set [{0}]
     b2cConverter.unknownEncoding=The character encoding [{0}] is not supported
     
     byteBufferUtils.cleaner=Cannot use direct ByteBuffer cleaner, memory leaking may occur
     
    +c2bConverter.encoderResetFail=Failed to reset instance of encoder for character set [{0}]
    +
     chunk.overflow=Buffer overflow and no sink is set, limit [{0}] and buffer length [{1}]
     
     encodedSolidusHandling.invalid=The value [{0}] is not recognised
    
  • webapps/docs/changelog.xml+4 0 modified
    @@ -125,6 +125,10 @@
             <bug>67472</bug>: Send fewer CORS-related headers when CORS is not
             actually being engaged. (schultz)
           </fix>
    +      <add>
    +        Improve handling of failures within <code>recycle()</code> methods.
    +        (markt)
    +      </add>
         </changelog>
       </subsection>
       <subsection name="Coyote">
    
44d05d75d696

Improve handling of failures during recycle() methods

https://github.com/apache/tomcatMark ThomasOct 5, 2023via ghsa
14 files changed · +52 6
  • java/org/apache/catalina/connector/LocalStrings.properties+1 0 modified
    @@ -51,6 +51,7 @@ coyoteRequest.attributeEvent=Exception thrown by attributes event listener
     coyoteRequest.authenticate.ise=Cannot call authenticate() after the response has been committed
     coyoteRequest.changeSessionId=Cannot change session ID. There is no session associated with this request.
     coyoteRequest.chunkedPostTooLarge=Parameters were not parsed because the size of the posted data was too big. Because this request was a chunked request, it could not be processed further. Use the maxPostSize attribute of the connector to resolve this if the application should accept large POSTs.
    +coyoteRequest.deletePartFailed=Failed to deleted temporary file used for part [{0}]
     coyoteRequest.filterAsyncSupportUnknown=Unable to determine if any filters do not support async processing
     coyoteRequest.getContextPath.ise=Unable to find match between the canonical context path [{0}] and the URI presented by the user agent [{1}]
     coyoteRequest.getInputStream.ise=getReader() has already been called for this request
    
  • java/org/apache/catalina/connector/Request.java+4 3 modified
    @@ -473,8 +473,9 @@ public void recycle() {
                 for (Part part : parts) {
                     try {
                         part.delete();
    -                } catch (IOException ignored) {
    -                    // ApplicationPart.delete() never throws an IOEx
    +                } catch (Throwable t) {
    +                    ExceptionUtils.handleThrowable(t);
    +                    log.warn(sm.getString("coyoteRequest.deletePartFailed", part.getName()), t);
                     }
                 }
                 parts = null;
    @@ -527,8 +528,8 @@ public void recycle() {
             asyncSupported = null;
             if (asyncContext != null) {
                 asyncContext.recycle();
    +            asyncContext = null;
             }
    -        asyncContext = null;
         }
     
     
    
  • java/org/apache/catalina/core/ApplicationHttpRequest.java+7 1 modified
    @@ -48,6 +48,7 @@
     import org.apache.catalina.util.ParameterMap;
     import org.apache.catalina.util.RequestUtil;
     import org.apache.catalina.util.URLEncoder;
    +import org.apache.tomcat.util.ExceptionUtils;
     import org.apache.tomcat.util.buf.B2CConverter;
     import org.apache.tomcat.util.buf.MessageBytes;
     import org.apache.tomcat.util.http.Parameters;
    @@ -618,7 +619,12 @@ public PushBuilder newPushBuilder() {
          */
         public void recycle() {
             if (session != null) {
    -            session.endAccess();
    +            try {
    +                session.endAccess();
    +            } catch (Throwable t) {
    +                ExceptionUtils.handleThrowable(t);
    +                context.getLogger().warn(sm.getString("applicationHttpRequest.sessionEndAccessFail"), t);
    +            }
             }
         }
     
    
  • java/org/apache/catalina/core/LocalStrings_cs.properties+2 0 modified
    @@ -24,6 +24,8 @@ applicationDispatcher.specViolation.response=Původní ServletResponse nebo zapo
     
     applicationFilterRegistration.nullInitParams=Není možné nastavit inicializační parametry pro filtr kvůli hodnotě null ve jménu či hodnotě. Jméno [{0}], Hodnota [{1}]
     
    +applicationHttpRequest.sessionEndAccessFail=Výjimka vyvolala ukončení přístupu k session během recykllování dotazu
    +
     aprListener.initializingFIPS=Inicializace FIPS módu...
     
     containerBase.backgroundProcess.cluster=Výjimka při zpracování procesu na pozadí v clusteru [{0}]
    
  • java/org/apache/catalina/core/LocalStrings_es.properties+2 0 modified
    @@ -52,6 +52,8 @@ applicationFilterConfig.jmxUnregisterFail=Ha fallado el desregistro JMX para el
     applicationFilterRegistration.nullInitParam=No puedo poner el parámetro de inicialización para el filtro debido a un nombre nulo y/o valor. Nombre [{0}], Valor [{1}]
     applicationFilterRegistration.nullInitParams=No puedo poner los parámetros de inicialización para el filtro debido a un nombre nulo y/o valor. Nombre [{0}], Valor [{1}]
     
    +applicationHttpRequest.sessionEndAccessFail=Excepción disparada acabando acceso a sesión mientras se reciclaba el requerimiento
    +
     applicationServletRegistration.setServletSecurity.iae=Se ha especificado restricción Null para el servlet [{0}] desplegado en el contexto con el nombre [{1}]
     applicationServletRegistration.setServletSecurity.ise=No se pueden añadir restricciones de seguridad al servlet [{0}] desplegado en el contexto con el nombre [{1}] ya que el contexto ya ha sido inicializado.
     
    
  • java/org/apache/catalina/core/LocalStrings_fr.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=Impossible de fixer le paramètre d'
     applicationFilterRegistration.nullInitParams=Impossible de fixer les paramètres d''initialisation du filtre, à cause d''un nom ou d''une valeur nulle, nom [{0}], valeur [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=Le fragment dans le chemin de dispatch [{0}] a été enlevé
    +applicationHttpRequest.sessionEndAccessFail=Exception lancée durant l'arrêt de l'accès à la session durant le recyclage de la requête
     
     applicationPushBuilder.methodInvalid=La méthode HTTP pour une requête push doit être à la fois être sans danger et pouvoir être mise en cache, mais [{0}] ne correspond pas
     applicationPushBuilder.methodNotToken=Les méthodes HTTP doivent être des "token", mais [{0}] contient un caractère invalide dans un token.
    
  • java/org/apache/catalina/core/LocalStrings_ja.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=NULLの名前や値のためにフ
     applicationFilterRegistration.nullInitParams=キー [{0}] または値 [{1}] のいずれかが null のためフィルターの初期化パラメータを設定できません。
     
     applicationHttpRequest.fragmentInDispatchPath=ディスパッチパス [{0}] 中のフラグメントは除去されました
    +applicationHttpRequest.sessionEndAccessFail=リクエストの再利用中に行ったセッションへのアクセス終了処理で例外が送出されました。
     
     applicationPushBuilder.methodInvalid=プッシュリクエストの HTTP メソッドはキャッシュ可能、かつ、安全でなければなりません。[{0}] は指定できません。
     applicationPushBuilder.methodNotToken=HTTP メソッド [{0}] にトークンとして利用できない文字が含まれています。
    
  • java/org/apache/catalina/core/LocalStrings_ko.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=이름 또는 값 또는 둘 다 널
     applicationFilterRegistration.nullInitParams=널인 이름 또는 값 때문에, 필터의 초기화 파라미터를 설정할 수 없습니다. 이름: [{0}], 값: [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=디스패치 경로 [{0}](으)로부터 URI fragment를 제거했습니다.
    +applicationHttpRequest.sessionEndAccessFail=요청을 참조 해제하는 과정에서, 세션에 대한 접근을 종료시키려 개시하는 중 예외 발생
     
     applicationPushBuilder.methodInvalid=PUSH 요청을 위한 HTTP 메소드는 반드시 캐시 가능하고 안전해야 하는데, [{0}]은(는) 그렇지 않습니다.
     applicationPushBuilder.methodNotToken=HTTP 메소드들은 토큰들이어야 하지만, [{0}]은(는) 토큰이 아닌 문자를 포함하고 있습니다.
    
  • java/org/apache/catalina/core/LocalStrings.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=Unable to set initialisation paramet
     applicationFilterRegistration.nullInitParams=Unable to set initialisation parameters for filter due to null name and/or value. Name [{0}], Value [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=The fragment in dispatch path [{0}] has been removed
    +applicationHttpRequest.sessionEndAccessFail=Exception triggered ending access to session while recycling request
     
     applicationPushBuilder.methodInvalid=The HTTP method for a push request must be both cacheable and safe but [{0}] is not
     applicationPushBuilder.methodNotToken=HTTP methods must be tokens but [{0}] contains a non-token character
    
  • java/org/apache/catalina/core/LocalStrings_zh_CN.properties+1 0 modified
    @@ -60,6 +60,7 @@ applicationFilterRegistration.nullInitParam=由于名称和/或值为空,无
     applicationFilterRegistration.nullInitParams=由于name和(或)value为null,无法为过滤器设置初始化参数。name为 [{0}],value为 [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=调度路径[{0}]中的片段已被删除
    +applicationHttpRequest.sessionEndAccessFail=在回收请求时,异常触发了对会话的结束访问。
     
     applicationPushBuilder.methodInvalid=推送请求的HTTP方法必须既可缓存又安全,但是[{0}]不是
     applicationPushBuilder.methodNotToken=HTTP方法必须是令牌(token),但 [{0}] 包含非令牌字符
    
  • java/org/apache/tomcat/util/buf/B2CConverter.java+10 1 modified
    @@ -27,13 +27,17 @@
     import java.nio.charset.StandardCharsets;
     import java.util.Locale;
     
    +import org.apache.juli.logging.Log;
    +import org.apache.juli.logging.LogFactory;
    +import org.apache.tomcat.util.ExceptionUtils;
     import org.apache.tomcat.util.res.StringManager;
     
     /**
      * NIO based character decoder.
      */
     public class B2CConverter {
     
    +    private static final Log log = LogFactory.getLog(B2CConverter.class);
         private static final StringManager sm = StringManager.getManager(B2CConverter.class);
     
         private static final CharsetCache charsetCache = new CharsetCache();
    @@ -104,7 +108,12 @@ public B2CConverter(Charset charset, boolean replaceOnError) {
          * Reset the decoder state.
          */
         public void recycle() {
    -        decoder.reset();
    +        try {
    +            decoder.reset();
    +        } catch (Throwable t) {
    +            ExceptionUtils.handleThrowable(t);
    +            log.warn(sm.getString("b2cConverter.decoderResetFail", decoder.charset()), t);
    +        }
             leftovers.position(0);
         }
     
    
  • java/org/apache/tomcat/util/buf/C2BConverter.java+14 1 modified
    @@ -24,11 +24,19 @@
     import java.nio.charset.CoderResult;
     import java.nio.charset.CodingErrorAction;
     
    +import org.apache.juli.logging.Log;
    +import org.apache.juli.logging.LogFactory;
    +import org.apache.tomcat.util.ExceptionUtils;
    +import org.apache.tomcat.util.res.StringManager;
    +
     /**
      * NIO based character encoder.
      */
     public final class C2BConverter {
     
    +    private static final Log log = LogFactory.getLog(C2BConverter.class);
    +    private static final StringManager sm = StringManager.getManager(C2BConverter.class);
    +
         private final CharsetEncoder encoder;
         private ByteBuffer bb = null;
         private CharBuffer cb = null;
    @@ -49,7 +57,12 @@ public C2BConverter(Charset charset) {
          * Reset the encoder state.
          */
         public void recycle() {
    -        encoder.reset();
    +        try {
    +            encoder.reset();
    +        } catch (Throwable t) {
    +            ExceptionUtils.handleThrowable(t);
    +            log.warn(sm.getString("c2bConverter.decoderResetFail", encoder.charset()), t);
    +        }
             leftovers.position(0);
         }
     
    
  • java/org/apache/tomcat/util/buf/LocalStrings.properties+3 0 modified
    @@ -16,10 +16,13 @@
     asn1Parser.lengthInvalid=Invalid length [{0}] bytes reported when the input data length is [{1}] bytes
     asn1Parser.tagMismatch=Expected to find value [{0}] but found value [{1}]
     
    +b2cConverter.decoderResetFail=Failed to reset instance of decoder for character set [{0}]
     b2cConverter.unknownEncoding=The character encoding [{0}] is not supported
     
     byteBufferUtils.cleaner=Cannot use direct ByteBuffer cleaner, memory leaking may occur
     
    +c2bConverter.encoderResetFail=Failed to reset instance of encoder for character set [{0}]
    +
     chunk.overflow=Buffer overflow and no sink is set, limit [{0}] and buffer length [{1}]
     
     encodedSolidusHandling.invalid=The value [{0}] is not recognised
    
  • webapps/docs/changelog.xml+4 0 modified
    @@ -125,6 +125,10 @@
             <bug>67472</bug>: Send fewer CORS-related headers when CORS is not
             actually being engaged. (schultz)
           </fix>
    +      <add>
    +        Improve handling of failures within <code>recycle()</code> methods.
    +        (markt)
    +      </add>
         </changelog>
       </subsection>
       <subsection name="Coyote">
    
30f8063d7a9b

Improve handling of failures during recycle() methods

https://github.com/apache/tomcatMark ThomasOct 5, 2023via ghsa
13 files changed · +50 6
  • java/org/apache/catalina/connector/LocalStrings.properties+1 0 modified
    @@ -51,6 +51,7 @@ coyoteRequest.attributeEvent=Exception thrown by attributes event listener
     coyoteRequest.authenticate.ise=Cannot call authenticate() after the response has been committed
     coyoteRequest.changeSessionId=Cannot change session ID. There is no session associated with this request.
     coyoteRequest.chunkedPostTooLarge=Parameters were not parsed because the size of the posted data was too big. Because this request was a chunked request, it could not be processed further. Use the maxPostSize attribute of the connector to resolve this if the application should accept large POSTs.
    +coyoteRequest.deletePartFailed=Failed to deleted temporary file used for part [{0}]
     coyoteRequest.filterAsyncSupportUnknown=Unable to determine if any filters do not support async processing
     coyoteRequest.getContextPath.ise=Unable to find match between the canonical context path [{0}] and the URI presented by the user agent [{1}]
     coyoteRequest.getInputStream.ise=getReader() has already been called for this request
    
  • java/org/apache/catalina/connector/Request.java+4 3 modified
    @@ -466,8 +466,9 @@ public void recycle() {
                 for (Part part : parts) {
                     try {
                         part.delete();
    -                } catch (IOException ignored) {
    -                    // ApplicationPart.delete() never throws an IOEx
    +                } catch (Throwable t) {
    +                    ExceptionUtils.handleThrowable(t);
    +                    log.warn(sm.getString("coyoteRequest.deletePartFailed", part.getName()), t);
                     }
                 }
                 parts = null;
    @@ -520,8 +521,8 @@ public void recycle() {
             asyncSupported = null;
             if (asyncContext != null) {
                 asyncContext.recycle();
    +            asyncContext = null;
             }
    -        asyncContext = null;
         }
     
     
    
  • java/org/apache/catalina/core/ApplicationHttpRequest.java+7 1 modified
    @@ -45,6 +45,7 @@
     import org.apache.catalina.util.ParameterMap;
     import org.apache.catalina.util.RequestUtil;
     import org.apache.catalina.util.URLEncoder;
    +import org.apache.tomcat.util.ExceptionUtils;
     import org.apache.tomcat.util.buf.B2CConverter;
     import org.apache.tomcat.util.buf.MessageBytes;
     import org.apache.tomcat.util.http.Parameters;
    @@ -613,7 +614,12 @@ public ApplicationPushBuilder newPushBuilder() {
          */
         public void recycle() {
             if (session != null) {
    -            session.endAccess();
    +            try {
    +                session.endAccess();
    +            } catch (Throwable t) {
    +                ExceptionUtils.handleThrowable(t);
    +                context.getLogger().warn(sm.getString("applicationHttpRequest.sessionEndAccessFail"), t);
    +            }
             }
         }
     
    
  • java/org/apache/catalina/core/LocalStrings_es.properties+2 0 modified
    @@ -52,6 +52,8 @@ applicationFilterConfig.jmxUnregisterFail=Ha fallado el desregistro JMX para el
     applicationFilterRegistration.nullInitParam=No puedo poner el parámetro de inicialización para el filtro debido a un nombre nulo y/o valor. Nombre [{0}], Valor [{1}]
     applicationFilterRegistration.nullInitParams=No puedo poner los parámetros de inicialización para el filtro debido a un nombre nulo y/o valor. Nombre [{0}], Valor [{1}]
     
    +applicationHttpRequest.sessionEndAccessFail=Excepción disparada acabando acceso a sesión mientras se reciclaba el requerimiento
    +
     applicationServletRegistration.setServletSecurity.iae=Se ha especificado restricción Null para el servlet [{0}] desplegado en el contexto con el nombre [{1}]
     applicationServletRegistration.setServletSecurity.ise=No se pueden añadir restricciones de seguridad al servlet [{0}] desplegado en el contexto con el nombre [{1}] ya que el contexto ya ha sido inicializado.
     
    
  • java/org/apache/catalina/core/LocalStrings_fr.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=Impossible de fixer le paramètre d'
     applicationFilterRegistration.nullInitParams=Impossible de fixer les paramètres d''initialisation du filtre, à cause d''un nom ou d''une valeur nulle, nom [{0}], valeur [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=Le fragment dans le chemin de dispatch [{0}] a été enlevé
    +applicationHttpRequest.sessionEndAccessFail=Exception lancée durant l'arrêt de l'accès à la session durant le recyclage de la requête
     
     applicationPushBuilder.methodInvalid=La méthode HTTP pour une requête push doit être à la fois être sans danger et pouvoir être mise en cache, mais [{0}] ne correspond pas
     applicationPushBuilder.methodNotToken=Les méthodes HTTP doivent être des "token", mais [{0}] contient un caractère invalide dans un token.
    
  • java/org/apache/catalina/core/LocalStrings_ja.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=NULLの名前や値のためにフ
     applicationFilterRegistration.nullInitParams=キー [{0}] または値 [{1}] のいずれかが null のためフィルターの初期化パラメータを設定できません。
     
     applicationHttpRequest.fragmentInDispatchPath=ディスパッチパス [{0}] 中のフラグメントは除去されました
    +applicationHttpRequest.sessionEndAccessFail=リクエストの再利用中に行ったセッションへのアクセス終了処理で例外が送出されました。
     
     applicationPushBuilder.methodInvalid=プッシュリクエストの HTTP メソッドはキャッシュ可能、かつ、安全でなければなりません。[{0}] は指定できません。
     applicationPushBuilder.methodNotToken=HTTP メソッド [{0}] にトークンとして利用できない文字が含まれています。
    
  • java/org/apache/catalina/core/LocalStrings_ko.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=이름 또는 값 또는 둘 다 널
     applicationFilterRegistration.nullInitParams=널인 이름 또는 값 때문에, 필터의 초기화 파라미터를 설정할 수 없습니다. 이름: [{0}], 값: [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=디스패치 경로 [{0}](으)로부터 URI fragment를 제거했습니다.
    +applicationHttpRequest.sessionEndAccessFail=요청을 참조 해제하는 과정에서, 세션에 대한 접근을 종료시키려 개시하는 중 예외 발생
     
     applicationPushBuilder.methodInvalid=PUSH 요청을 위한 HTTP 메소드는 반드시 캐시 가능하고 안전해야 하는데, [{0}]은(는) 그렇지 않습니다.
     applicationPushBuilder.methodNotToken=HTTP 메소드들은 토큰들이어야 하지만, [{0}]은(는) 토큰이 아닌 문자를 포함하고 있습니다.
    
  • java/org/apache/catalina/core/LocalStrings.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=Unable to set initialisation paramet
     applicationFilterRegistration.nullInitParams=Unable to set initialisation parameters for filter due to null name and/or value. Name [{0}], Value [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=The fragment in dispatch path [{0}] has been removed
    +applicationHttpRequest.sessionEndAccessFail=Exception triggered ending access to session while recycling request
     
     applicationPushBuilder.methodInvalid=The HTTP method for a push request must be both cacheable and safe but [{0}] is not
     applicationPushBuilder.methodNotToken=HTTP methods must be tokens but [{0}] contains a non-token character
    
  • java/org/apache/catalina/core/LocalStrings_zh_CN.properties+1 0 modified
    @@ -60,6 +60,7 @@ applicationFilterRegistration.nullInitParam=由于名称和/或值为空,无
     applicationFilterRegistration.nullInitParams=由于name和(或)value为null,无法为过滤器设置初始化参数。name为 [{0}],value为 [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=调度路径[{0}]中的片段已被删除
    +applicationHttpRequest.sessionEndAccessFail=在回收请求时,异常触发了对会话的结束访问。
     
     applicationPushBuilder.methodInvalid=推送请求的HTTP方法必须既可缓存又安全,但是[{0}]不是
     applicationPushBuilder.methodNotToken=HTTP方法必须是令牌(token),但 [{0}] 包含非令牌字符
    
  • java/org/apache/tomcat/util/buf/B2CConverter.java+10 1 modified
    @@ -27,13 +27,17 @@
     import java.nio.charset.StandardCharsets;
     import java.util.Locale;
     
    +import org.apache.juli.logging.Log;
    +import org.apache.juli.logging.LogFactory;
    +import org.apache.tomcat.util.ExceptionUtils;
     import org.apache.tomcat.util.res.StringManager;
     
     /**
      * NIO based character decoder.
      */
     public class B2CConverter {
     
    +    private static final Log log = LogFactory.getLog(B2CConverter.class);
         private static final StringManager sm = StringManager.getManager(B2CConverter.class);
     
         private static final CharsetCache charsetCache = new CharsetCache();
    @@ -122,7 +126,12 @@ public B2CConverter(Charset charset, boolean replaceOnError) {
          * Reset the decoder state.
          */
         public void recycle() {
    -        decoder.reset();
    +        try {
    +            decoder.reset();
    +        } catch (Throwable t) {
    +            ExceptionUtils.handleThrowable(t);
    +            log.warn(sm.getString("b2cConverter.decoderResetFail", decoder.charset()), t);
    +        }
             leftovers.position(0);
         }
     
    
  • java/org/apache/tomcat/util/buf/C2BConverter.java+14 1 modified
    @@ -24,11 +24,19 @@
     import java.nio.charset.CoderResult;
     import java.nio.charset.CodingErrorAction;
     
    +import org.apache.juli.logging.Log;
    +import org.apache.juli.logging.LogFactory;
    +import org.apache.tomcat.util.ExceptionUtils;
    +import org.apache.tomcat.util.res.StringManager;
    +
     /**
      * NIO based character encoder.
      */
     public final class C2BConverter {
     
    +    private static final Log log = LogFactory.getLog(C2BConverter.class);
    +    private static final StringManager sm = StringManager.getManager(C2BConverter.class);
    +
         private final CharsetEncoder encoder;
         private ByteBuffer bb = null;
         private CharBuffer cb = null;
    @@ -49,7 +57,12 @@ public C2BConverter(Charset charset) {
          * Reset the encoder state.
          */
         public void recycle() {
    -        encoder.reset();
    +        try {
    +            encoder.reset();
    +        } catch (Throwable t) {
    +            ExceptionUtils.handleThrowable(t);
    +            log.warn(sm.getString("c2bConverter.decoderResetFail", encoder.charset()), t);
    +        }
             leftovers.position(0);
         }
     
    
  • java/org/apache/tomcat/util/buf/LocalStrings.properties+3 0 modified
    @@ -16,10 +16,13 @@
     asn1Parser.lengthInvalid=Invalid length [{0}] bytes reported when the input data length is [{1}] bytes
     asn1Parser.tagMismatch=Expected to find value [{0}] but found value [{1}]
     
    +b2cConverter.decoderResetFail=Failed to reset instance of decoder for character set [{0}]
     b2cConverter.unknownEncoding=The character encoding [{0}] is not supported
     
     byteBufferUtils.cleaner=Cannot use direct ByteBuffer cleaner, memory leaking may occur
     
    +c2bConverter.encoderResetFail=Failed to reset instance of encoder for character set [{0}]
    +
     chunk.overflow=Buffer overflow and no sink is set, limit [{0}] and buffer length [{1}]
     
     encodedSolidusHandling.invalid=The value [{0}] is not recognised
    
  • webapps/docs/changelog.xml+4 0 modified
    @@ -125,6 +125,10 @@
             <bug>67472</bug>: Send fewer CORS-related headers when CORS is not
             actually being engaged. (schultz)
           </fix>
    +      <add>
    +        Improve handling of failures within <code>recycle()</code> methods.
    +        (markt)
    +      </add>
         </changelog>
       </subsection>
       <subsection name="Coyote">
    
9375d67106f8

Improve handling of failures during recycle() methods

https://github.com/apache/tomcatMark ThomasOct 5, 2023via ghsa
14 files changed · +52 6
  • java/org/apache/catalina/connector/LocalStrings.properties+1 0 modified
    @@ -49,6 +49,7 @@ coyoteRequest.attributeEvent=Exception thrown by attributes event listener
     coyoteRequest.authenticate.ise=Cannot call authenticate() after the response has been committed
     coyoteRequest.changeSessionId=Cannot change session ID. There is no session associated with this request.
     coyoteRequest.chunkedPostTooLarge=Parameters were not parsed because the size of the posted data was too big. Because this request was a chunked request, it could not be processed further. Use the maxPostSize attribute of the connector to resolve this if the application should accept large POSTs.
    +coyoteRequest.deletePartFailed=Failed to deleted temporary file used for part [{0}]
     coyoteRequest.filterAsyncSupportUnknown=Unable to determine if any filters do not support async processing
     coyoteRequest.getContextPath.ise=Unable to find match between the canonical context path [{0}] and the URI presented by the user agent [{1}]
     coyoteRequest.getInputStream.ise=getReader() has already been called for this request
    
  • java/org/apache/catalina/connector/Request.java+4 3 modified
    @@ -444,8 +444,9 @@ public void recycle() {
                 for (Part part : parts) {
                     try {
                         part.delete();
    -                } catch (IOException ignored) {
    -                    // ApplicationPart.delete() never throws an IOEx
    +                } catch (Throwable t) {
    +                    ExceptionUtils.handleThrowable(t);
    +                    log.warn(sm.getString("coyoteRequest.deletePartFailed", part.getName()), t);
                     }
                 }
                 parts = null;
    @@ -498,8 +499,8 @@ public void recycle() {
             asyncSupported = null;
             if (asyncContext != null) {
                 asyncContext.recycle();
    +            asyncContext = null;
             }
    -        asyncContext = null;
         }
     
     
    
  • java/org/apache/catalina/core/ApplicationHttpRequest.java+7 1 modified
    @@ -48,6 +48,7 @@
     import org.apache.catalina.util.ParameterMap;
     import org.apache.catalina.util.RequestUtil;
     import org.apache.catalina.util.URLEncoder;
    +import org.apache.tomcat.util.ExceptionUtils;
     import org.apache.tomcat.util.buf.B2CConverter;
     import org.apache.tomcat.util.buf.MessageBytes;
     import org.apache.tomcat.util.http.Parameters;
    @@ -618,7 +619,12 @@ public PushBuilder newPushBuilder() {
          */
         public void recycle() {
             if (session != null) {
    -            session.endAccess();
    +            try {
    +                session.endAccess();
    +            } catch (Throwable t) {
    +                ExceptionUtils.handleThrowable(t);
    +                context.getLogger().warn(sm.getString("applicationHttpRequest.sessionEndAccessFail"), t);
    +            }
             }
         }
     
    
  • java/org/apache/catalina/core/LocalStrings_cs.properties+2 0 modified
    @@ -24,6 +24,8 @@ applicationDispatcher.specViolation.response=Původní ServletResponse nebo zapo
     
     applicationFilterRegistration.nullInitParams=Není možné nastavit inicializační parametry pro filtr kvůli hodnotě null ve jménu či hodnotě. Jméno [{0}], Hodnota [{1}]
     
    +applicationHttpRequest.sessionEndAccessFail=Výjimka vyvolala ukončení přístupu k session během recykllování dotazu
    +
     aprListener.initializingFIPS=Inicializace FIPS módu...
     
     containerBase.backgroundProcess.cluster=Výjimka při zpracování procesu na pozadí v clusteru [{0}]
    
  • java/org/apache/catalina/core/LocalStrings_es.properties+2 0 modified
    @@ -52,6 +52,8 @@ applicationFilterConfig.jmxUnregisterFail=Ha fallado el desregistro JMX para el
     applicationFilterRegistration.nullInitParam=No puedo poner el parámetro de inicialización para el filtro debido a un nombre nulo y/o valor. Nombre [{0}], Valor [{1}]
     applicationFilterRegistration.nullInitParams=No puedo poner los parámetros de inicialización para el filtro debido a un nombre nulo y/o valor. Nombre [{0}], Valor [{1}]
     
    +applicationHttpRequest.sessionEndAccessFail=Excepción disparada acabando acceso a sesión mientras se reciclaba el requerimiento
    +
     applicationServletRegistration.setServletSecurity.iae=Se ha especificado restricción Null para el servlet [{0}] desplegado en el contexto con el nombre [{1}]
     applicationServletRegistration.setServletSecurity.ise=No se pueden añadir restricciones de seguridad al servlet [{0}] desplegado en el contexto con el nombre [{1}] ya que el contexto ya ha sido inicializado.
     
    
  • java/org/apache/catalina/core/LocalStrings_fr.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=Impossible de fixer le paramètre d'
     applicationFilterRegistration.nullInitParams=Impossible de fixer les paramètres d''initialisation du filtre, à cause d''un nom ou d''une valeur nulle, nom [{0}], valeur [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=Le fragment dans le chemin de dispatch [{0}] a été enlevé
    +applicationHttpRequest.sessionEndAccessFail=Exception lancée durant l'arrêt de l'accès à la session durant le recyclage de la requête
     
     applicationPushBuilder.methodInvalid=La méthode HTTP pour une requête push doit être à la fois être sans danger et pouvoir être mise en cache, mais [{0}] ne correspond pas
     applicationPushBuilder.methodNotToken=Les méthodes HTTP doivent être des "token", mais [{0}] contient un caractère invalide dans un token.
    
  • java/org/apache/catalina/core/LocalStrings_ja.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=NULLの名前や値のためにフ
     applicationFilterRegistration.nullInitParams=キー [{0}] または値 [{1}] のいずれかが null のためフィルターの初期化パラメータを設定できません。
     
     applicationHttpRequest.fragmentInDispatchPath=ディスパッチパス [{0}] 中のフラグメントは除去されました
    +applicationHttpRequest.sessionEndAccessFail=リクエストの再利用中に行ったセッションへのアクセス終了処理で例外が送出されました。
     
     applicationPushBuilder.methodInvalid=プッシュリクエストの HTTP メソッドはキャッシュ可能、かつ、安全でなければなりません。[{0}] は指定できません。
     applicationPushBuilder.methodNotToken=HTTP メソッド [{0}] にトークンとして利用できない文字が含まれています。
    
  • java/org/apache/catalina/core/LocalStrings_ko.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=이름 또는 값 또는 둘 다 널
     applicationFilterRegistration.nullInitParams=널인 이름 또는 값 때문에, 필터의 초기화 파라미터를 설정할 수 없습니다. 이름: [{0}], 값: [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=디스패치 경로 [{0}](으)로부터 URI fragment를 제거했습니다.
    +applicationHttpRequest.sessionEndAccessFail=요청을 참조 해제하는 과정에서, 세션에 대한 접근을 종료시키려 개시하는 중 예외 발생
     
     applicationPushBuilder.methodInvalid=PUSH 요청을 위한 HTTP 메소드는 반드시 캐시 가능하고 안전해야 하는데, [{0}]은(는) 그렇지 않습니다.
     applicationPushBuilder.methodNotToken=HTTP 메소드들은 토큰들이어야 하지만, [{0}]은(는) 토큰이 아닌 문자를 포함하고 있습니다.
    
  • java/org/apache/catalina/core/LocalStrings.properties+1 0 modified
    @@ -59,6 +59,7 @@ applicationFilterRegistration.nullInitParam=Unable to set initialisation paramet
     applicationFilterRegistration.nullInitParams=Unable to set initialisation parameters for filter due to null name and/or value. Name [{0}], Value [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=The fragment in dispatch path [{0}] has been removed
    +applicationHttpRequest.sessionEndAccessFail=Exception triggered ending access to session while recycling request
     
     applicationPushBuilder.methodInvalid=The HTTP method for a push request must be both cacheable and safe but [{0}] is not
     applicationPushBuilder.methodNotToken=HTTP methods must be tokens but [{0}] contains a non-token character
    
  • java/org/apache/catalina/core/LocalStrings_zh_CN.properties+1 0 modified
    @@ -60,6 +60,7 @@ applicationFilterRegistration.nullInitParam=由于名称和/或值为空,无
     applicationFilterRegistration.nullInitParams=由于name和(或)value为null,无法为过滤器设置初始化参数。name为 [{0}],value为 [{1}]
     
     applicationHttpRequest.fragmentInDispatchPath=调度路径[{0}]中的片段已被删除
    +applicationHttpRequest.sessionEndAccessFail=在回收请求时,异常触发了对会话的结束访问。
     
     applicationPushBuilder.methodInvalid=推送请求的HTTP方法必须既可缓存又安全,但是[{0}]不是
     applicationPushBuilder.methodNotToken=HTTP方法必须是令牌(token),但 [{0}] 包含非令牌字符
    
  • java/org/apache/tomcat/util/buf/B2CConverter.java+10 1 modified
    @@ -26,13 +26,17 @@
     import java.nio.charset.CodingErrorAction;
     import java.util.Locale;
     
    +import org.apache.juli.logging.Log;
    +import org.apache.juli.logging.LogFactory;
    +import org.apache.tomcat.util.ExceptionUtils;
     import org.apache.tomcat.util.res.StringManager;
     
     /**
      * NIO based character decoder.
      */
     public class B2CConverter {
     
    +    private static final Log log = LogFactory.getLog(B2CConverter.class);
         private static final StringManager sm = StringManager.getManager(B2CConverter.class);
     
         private static final CharsetCache charsetCache = new CharsetCache();
    @@ -96,7 +100,12 @@ public B2CConverter(Charset charset, boolean replaceOnError) {
          * Reset the decoder state.
          */
         public void recycle() {
    -        decoder.reset();
    +        try {
    +            decoder.reset();
    +        } catch (Throwable t) {
    +            ExceptionUtils.handleThrowable(t);
    +            log.warn(sm.getString("b2cConverter.decoderResetFail", decoder.charset()), t);
    +        }
             leftovers.position(0);
         }
     
    
  • java/org/apache/tomcat/util/buf/C2BConverter.java+14 1 modified
    @@ -24,11 +24,19 @@
     import java.nio.charset.CoderResult;
     import java.nio.charset.CodingErrorAction;
     
    +import org.apache.juli.logging.Log;
    +import org.apache.juli.logging.LogFactory;
    +import org.apache.tomcat.util.ExceptionUtils;
    +import org.apache.tomcat.util.res.StringManager;
    +
     /**
      * NIO based character encoder.
      */
     public final class C2BConverter {
     
    +    private static final Log log = LogFactory.getLog(C2BConverter.class);
    +    private static final StringManager sm = StringManager.getManager(C2BConverter.class);
    +
         private final CharsetEncoder encoder;
         private ByteBuffer bb = null;
         private CharBuffer cb = null;
    @@ -49,7 +57,12 @@ public C2BConverter(Charset charset) {
          * Reset the encoder state.
          */
         public void recycle() {
    -        encoder.reset();
    +        try {
    +            encoder.reset();
    +        } catch (Throwable t) {
    +            ExceptionUtils.handleThrowable(t);
    +            log.warn(sm.getString("c2bConverter.decoderResetFail", encoder.charset()), t);
    +        }
             leftovers.position(0);
         }
     
    
  • java/org/apache/tomcat/util/buf/LocalStrings.properties+3 0 modified
    @@ -16,10 +16,13 @@
     asn1Parser.lengthInvalid=Invalid length [{0}] bytes reported when the input data length is [{1}] bytes
     asn1Parser.tagMismatch=Expected to find value [{0}] but found value [{1}]
     
    +b2cConverter.decoderResetFail=Failed to reset instance of decoder for character set [{0}]
     b2cConverter.unknownEncoding=The character encoding [{0}] is not supported
     
     byteBufferUtils.cleaner=Cannot use direct ByteBuffer cleaner, memory leaking may occur
     
    +c2bConverter.encoderResetFail=Failed to reset instance of encoder for character set [{0}]
    +
     chunk.overflow=Buffer overflow and no sink is set, limit [{0}] and buffer length [{1}]
     
     encodedSolidusHandling.invalid=The value [{0}] is not recognised
    
  • webapps/docs/changelog.xml+4 0 modified
    @@ -125,6 +125,10 @@
             <bug>67472</bug>: Send fewer CORS-related headers when CORS is not
             actually being engaged. (schultz)
           </fix>
    +      <add>
    +        Improve handling of failures within <code>recycle()</code> methods.
    +        (markt)
    +      </add>
         </changelog>
       </subsection>
       <subsection name="Coyote">
    

Vulnerability mechanics

Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.

References

12

News mentions

0

No linked articles in our index yet.