You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HttpInvokerServiceExporter uses the default Java deserialization mechanism (InputObjectStream) to parse data that comes in a HTTP request. A malicious user can send a specially crafted request that contains a dangerous serialized object. Then, the endpoints deserialize the object which results in executing dangerous code on the server side.
The serialized object doesn't do anything dangerous - it just tries to resolve "blog.gypsyengineer.com" (you can use any other domain name). If you watch DNS traffic (tcpdump -i lo udp port 53) and run the code above, then you'll see a DNS request to resolve blog.gypsyengineer.com. Although it is only a demo to show the issue, it may be possible to build a serialized object that does something dangerous, for example, arbitrary code execution. Therefore the impact of the issue may be potentially high. It is relatively easy to exploit the issue - an attacker just needs to send a single HTTP request.
Unfortunately, Spring refused to make the HttpInvokerServiceExporter class safer
(after discussing this with the project maintainers, agreed to publish it)
The project has three API endpoints that use
HttpInvokerServiceExporter
yamj-v3/yamj3-core/src/main/java/org/yamj/core/remote/service/RemoteServiceConfiguration.java
Line 45 in 97ff93f
HttpInvokerServiceExporter
uses the default Java deserialization mechanism (InputObjectStream
) to parse data that comes in a HTTP request. A malicious user can send a specially crafted request that contains a dangerous serialized object. Then, the endpoints deserialize the object which results in executing dangerous code on the server side.The following code reproduces the issue:
payload.bin
is created by ysoserial tool:The serialized object doesn't do anything dangerous - it just tries to resolve "blog.gypsyengineer.com" (you can use any other domain name). If you watch DNS traffic (
tcpdump -i lo udp port 53
) and run the code above, then you'll see a DNS request to resolveblog.gypsyengineer.com
. Although it is only a demo to show the issue, it may be possible to build a serialized object that does something dangerous, for example, arbitrary code execution. Therefore the impact of the issue may be potentially high. It is relatively easy to exploit the issue - an attacker just needs to send a single HTTP request.Unfortunately, Spring refused to make the
HttpInvokerServiceExporter
class saferspring-projects/spring-framework#24434
They only deprecated the class and updated the documentation. There are not too many ways to fix the issue:
HttpInvokerServiceExporter
.The text was updated successfully, but these errors were encountered: