You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2024/12/04 03:14:37 UTC
[Bug 69486] New: Destroy data in memory completely after the request-response service is finished
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
Bug ID: 69486
Summary: Destroy data in memory completely after the
request-response service is finished
Product: Tomcat 10
Version: 10.1.33
Hardware: PC
Status: NEW
Severity: enhancement
Priority: P2
Component: Connectors
Assignee: dev@tomcat.apache.org
Reporter: ch_jp@msn.com
Target Milestone: ------
Till now, recycle/clear ops in Request/Response/InputBuffer/OutputBuffer do not
clear not-in-use data completely.
As Murphy's Law, to reduce the risk of information lea, propose fulfill
ByteBuffer / CharBuffer content array with 0 together with resource recycle
once request-response #service is finished.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69486] Destroy data in memory completely after the request-response service is finished
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
--- Comment #8 from Chen Jp <ch...@msn.com> ---
It is similar to DBCP alive checking in testOnBorrow() / testOnReturn().
Provides an extra opportunity, ensure that request/response are fresh and clean
when taken (borrow) from / returned to a pool or serving context.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69486] Destroy data in memory completely after the request-response service is finished
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
--- Comment #7 from Mark Thomas <ma...@apache.org> ---
(In reply to Chen Jp from comment #6)
> related cve: CVE-2024-21733
Sort of but not really. The root cause of that CVE was an error path that
bypassed resetting the buffer. It is just as likely that the zeroing out would
have been bypassed.
Zeroing out the buffer isn't a guaranteed fix. Just like ByteBuffer.limit(0),
it only works if the code is actually called.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69486] Destroy data in memory completely after the request-response service is finished
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
--- Comment #9 from Mark Thomas <ma...@apache.org> ---
It will also have a negative impact on performance.
The more I think about this, the more I am leaning towards WONTFIX.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69486] Destroy data in memory completely after the request-response service is finished
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
--- Comment #3 from Christopher Schultz <ch...@christopherschultz.net> ---
Setting the length of the buffer to 0 should be enough (e.g. limit(0)). If
there are data-leakage bugs in ByteBuffer, they should be fixed.
Writing zeros to the buffer may or may not happen, depending upon a few things.
It may also not do what you are expecting. In Java, zeroing-out memory does not
protect against secrets floating in RAM since objects can be relocated at any
time, and the JVM does not guarantee zero-ing out freed heap space.
Depending upon the implementation of Arrays.fill, it may come down to memset(0)
which is often simply a no-op under certain conditions.
Honestly, it is very difficult in a modern operating system, and especially
with Java, to ensure that sensitive artifacts are not left around in memory.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69486] Destroy data in memory completely after the request-response service is finished
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
--- Comment #10 from Chen Jp <ch...@msn.com> ---
see https://github.com/apache/tomcat/pull/822
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69486] Destroy data in memory completely after the request-response service is finished
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
--- Comment #2 from Mark Thomas <ma...@apache.org> ---
Even with those caveats, I'm not sure I'd be in favour of this. I'm leaning
towards "won't fix".
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69486] Destroy data in memory completely after the request-response service is finished
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
--- Comment #5 from Christopher Schultz <ch...@christopherschultz.net> ---
(In reply to Chen Jp from comment #4)
> [...] may very helpful to avoiding potential data leak.
Please give a hypothetical situation where data leakage can occur which does
not require exploiting the JVM.
> Next request/response cycle will not able to obtains context of previous
> service round.
ByteBuffer.limit(0) already does this.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69486] Destroy data in memory completely after the request-response service is finished
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
--- Comment #6 from Chen Jp <ch...@msn.com> ---
related cve: CVE-2024-21733
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69486] Destroy data in memory completely after the request-response service is finished
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
--- Comment #12 from Chen Jp <ch...@msn.com> ---
Would to know how apache httpd server deal cleanup ops. // I'm not a C fan.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69486] Destroy data in memory completely after the request-response service is finished
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
Remy Maucherat <re...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
OS| |All
--- Comment #1 from Remy Maucherat <re...@apache.org> ---
-1 unless optional and disabled by default. Bugs should be fixed instead of
adding pointless bandaids.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69486] Destroy data in memory completely after the request-response service is finished
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
--- Comment #4 from Chen Jp <ch...@msn.com> ---
For those reusable resources, when the current request processing is completed
or abnormally interrupted, if possible, intermediate data (which were serving
for current service lifecycle) purging in the resource recycle phase may very
helpful to avoiding potential data leak.
Next request/response cycle will not able to obtains context of previous
service round.
It's a defensive pattern, need trade off but nice to have. Because there are so
many occurrences to manipulate ByteBuffer/Message/... directly, very hard to
ensure every ops is secure and exceptions are handled properly.
Otherwise, wait for next information disclosure issue and fix them later.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org
[Bug 69486] Destroy data in memory completely after the request-response service is finished
Posted by bu...@apache.org.
https://bz.apache.org/bugzilla/show_bug.cgi?id=69486
Mark Thomas <ma...@apache.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Resolution|--- |WONTFIX
Status|NEW |RESOLVED
--- Comment #11 from Mark Thomas <ma...@apache.org> ---
The DBCP comparison is not valid. There are external factors that may
invalidate a database connection that the connection pool cannot detect unless
it tests the connection. There are tradeoffs for when it is best to perform
that test and DBCP provides a range of options to enabled applications to
select the strategy that works best for them.
This proposal might protect against some Tomcat bugs in some circumstances but
at the price of a performance penalty for every single request. I might be
convinced that such a trade-off was worth making if it guaranteed that it would
eliminate a class of bugs but it can't. CVE-2024-21733 being a case in point.
I'm not convinced that is a trade-off that is reasonable and I am not seeing
any other committers think it is either.
--
You are receiving this mail because:
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org