Red Hat JBoss Application Server insecure deserialization vulnerability

November 30, 2017

The JBoss Enterprise Application Platform is a subscription-based/open-source Java EE-based application server runtime platform used for building, deploying, and hosting highly-transactional Java applications and services.

Written by Java, the EAP supports a feature called serialization, which allows Java objects to be packed into a byte stream, and be deserializing by another Java application (such as applet). The methods of writeObject()/writeExternal() and readObject()/readExternal() from Serializable interface are used for serializing and deserializing.

An insecure deserialization vulnerability exists in Red Hat JBoss Application Server. When an URI starts with "/invoker/readonly", it will be handled by a class called ReadOnlyAccessFilter inside http-invoker.sar, more specifically, by the function doFilter(). However, the deserializing process failed to do validation on the object. That allows an attacker could include malicious data to call an exploitable library in the code path, triggering a remote code execution vulnerability. A successful attack will lead to arbitrary code execution in the security context of the root/system user.

 public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)   throws IOException, ServletException {   HttpServletRequest httpRequest = (HttpServletRequest)request;   Principal user = httpRequest.getUserPrincipal();   if ((user == null) && (this.readOnlyContext != null))   {     ServletInputStream sis = request.getInputStream();     ObjectInputStream ois = new ObjectInputStream(sis);     MarshalledInvocation mi = null;     try 	{ 		//Deserialization without filtering 		mi = (MarshalledInvocation)ois.readObject();      }     catch (ClassNotFoundException e)     {       throw new ServletException("Failed to read MarshalledInvocation", e);     }     request.setAttribute("MarshalledInvocation", mi); 

SonicWall Capture Labs Threat Research team has developed the following signature to identify and stop the attacks:

  • IPS 13104: Red Hat JBoss Application Server Insecure Deserialization