Blog Post

Azure Network Security Blog
5 MIN READ

Addressing Java4Shell CVE-2026-114938: upgrade guidance and Azure WAF mitigations

yuvalpery's avatar
yuvalpery
Icon for Microsoft rankMicrosoft
Nov 17, 2026

Introduction 

On November 17, 2026, CVE-2026-114938, also known as Java4Shell, a critical remote code execution (RCE) vulnerability affecting OpenJDK, was publicly disclosed. Under specific conditions, specially crafted Base64 input can trigger memory corruption in affected Java runtimes, potentially allowing unauthenticated attackers to execute arbitrary code. 

We strongly recommend that customers update the Java runtime used by their own applications to a patched version or update third-party Java-based applications to a version that includes the security fix, as applicable. Updating the affected Java runtime is the primary way to fully remediate this vulnerability. For further details, refer to Oracle's official security advisory. 

Azure Web Application Firewall (WAF) has developed mitigations designed to detect and block known HTTP-based exploitation patterns associated with this vulnerability, providing an additional layer of protection while customers apply the necessary security updates. These mitigations are intended to complement patching, not replace it. 

About CVE-2026-114938 

CVE-2026-114938 is a memory-corruption vulnerability in OpenJDK's hardware-accelerated Base64 decoder. When an affected Java application processes specially crafted Base64 input, the vulnerability can cause heap memory corruption, potentially leading to application crashes, sensitive information disclosure, or remote code execution. 

The vulnerability primarily affects unpatched OpenJDK-based Java runtimes version 17.0.6 and later, including Java 21, 25, and 27, running on x86-64 processors supporting the AVX-512 VBMI instruction set. Exploitation requires attacker-controlled input to reach the vulnerable Base64 decoding functionality. ARM64 systems and x86-64 processors without AVX-512 VBMI support are not known to be affected. 

Recommended action: Update affected Java runtimes and third-party Java-based applications to versions containing the security fix as soon as possible. Treat Azure WAF mitigations as supplementary protection, not as a substitute for patching. 

Azure WAF protection 

If you are unable to upgrade your Java application to a patched version immediately, apply the following mitigations in the interim. 

Azure Front Door 

Since the vulnerability is exploited through malformed Base64 input, apply the following WAF custom rules based on where your application accepts Base64-encoded values in incoming HTTP requests: 

  • Request headers: Apply the request headers rule and specify the relevant header names (e.g., Cookie). 
  • Request body: Apply the request body rule and specify the relevant HTTP POST argument name. 
  • Query string: Apply the query string rule. 
  • Authorization header: Apply the authorization header rule. 

If your application accepts Base64-encoded input in multiple parts of an HTTP request, apply all applicable rules to ensure comprehensive coverage. 

 

{
  "customRules": {
    "rules": [
      {
        "name": "Java4ShellB64Header",
        "priority": 10,
        "ruleType": "MatchRule",
        "action": "Block",
        "enabledState": "Enabled",
        "matchConditions": [
          {
            "matchVariable": "RequestHeader",
            "selector": "REPLACE_WITH_HEADER_NAME",
            "operator": "RegEx",
            "negateCondition": false,
            "matchValue": [
              "(?:\\A|[^A-Za-z0-9+/])(?:[A-Za-z0-9+/]{64})+(?:[A-Za-z0-9+/]{0,2}=|[A-Za-z0-9+/]?==)(?:\\z|[^A-Za-z0-9+/=])"
            ],
            "transforms": [
              "Trim"
            ]
          }
        ]
      },
      {
        "name": "Java4ShellB64BodyField",
        "priority": 11,
        "ruleType": "MatchRule",
        "action": "Block",
        "enabledState": "Enabled",
        "matchConditions": [
          {
            "matchVariable": "PostArgs",
            "selector": "REPLACE_WITH_BODY_FIELD_NAME",
            "operator": "RegEx",
            "negateCondition": false,
            "matchValue": [
              "\\A(?:[A-Za-z0-9+/]{64})+(?:[A-Za-z0-9+/]{0,2}=|[A-Za-z0-9+/]?==)\\z"
            ],
            "transforms": [
              "Trim"
            ]
          }
        ]
      },
      {
        "name": "Java4ShellB64Query",
        "priority": 12,
        "ruleType": "MatchRule",
        "action": "Block",
        "enabledState": "Enabled",
        "matchConditions": [
          {
            "matchVariable": "QueryString",
            "operator": "RegEx",
            "negateCondition": false,
            "matchValue": [
              "(?:\\A|&)[^&=]*=(?:[A-Za-z0-9+/]{64})+(?:[A-Za-z0-9+/]{0,2}=|[A-Za-z0-9+/]?==)(?:&|\\z)"
            ],
            "transforms": [
              "Trim"
            ]
          }
        ]
      },
      {
        "name": "Java4ShellB64Authorization",
        "priority": 13,
        "ruleType": "MatchRule",
        "action": "Block",
        "enabledState": "Enabled",
        "matchConditions": [
          {
            "matchVariable": "RequestHeader",
            "selector": "Authorization",
            "operator": "RegEx",
            "negateCondition": false,
            "matchValue": [
              "\\A(?:(?i:Bearer|Basic)\\s+)?(?:(?:[A-Za-z0-9+\\/]{64})+(?:[A-Za-z0-9+\\/]{0,2}=|[A-Za-z0-9+\\/]?==)|(?:[A-Za-z0-9_-]+=*\\.)?(?:[A-Za-z0-9_-]+=*\\.)?(?:[A-Za-z0-9_-]{64})+(?:[A-Za-z0-9_-]{0,2}=|[A-Za-z0-9_-]?==)(?:\\.[A-Za-z0-9_-]+=*){0,2})\\z"
            ],
            "transforms": [
              "Trim"
            ]
          }
        ]
      }
    ]
  }
}
 

Azure Application Gateway and Application Gateway for Containers 

Since the vulnerability is exploited through malformed Base64 input, you should apply the following WAF custom rules based on where your application accepts Base64-encoded values within incoming HTTP requests: 

  • Request headers: Apply the request headers rule. This rule applies to all request headers. 
  • Request body: Apply the request body rule. 
  • Query string: Apply the query string rule. 

If your application accepts Base64-encoded input in multiple parts of an HTTP request, apply all applicable rules to ensure comprehensive coverage of the relevant attack vectors. 

"customRules": [
            {
                "name": "Java4ShellB64BodyField",
                "priority": 10,
                "ruleType": "MatchRule",
                "action": "Block",
                "matchConditions": [
                    {
                        "matchVariables": [
                            {
                                "variableName": "PostArgs"
                            }
                        ],
                        "operator": "Regex",
                        "negationConditon": false,
                        "matchValues": [
                            "\\A(?:[A-Za-z0-9+/]{64})+(?:[A-Za-z0-9+/]{0,2}=|[A-Za-z0-9+/]?==)\\z"
                        ],
                        "transforms": [
                            "Trim"
                        ]
                    }
                ],
                "skippedManagedRuleSets": [],
                "state": "Enabled"
            },
            {
                "name": "Java4ShellB64Query",
                "priority": 11,
                "ruleType": "MatchRule",
                "action": "Block",
                "matchConditions": [
                    {
                        "matchVariables": [
                            {
                                "variableName": "QueryString"
                            }
                        ],
                        "operator": "Regex",
                        "negationConditon": false,
                        "matchValues": [
                            "(?:\\A|&)[^&=]*=(?:[A-Za-z0-9+/]{64})+(?:[A-Za-z0-9+/]{0,2}=|[A-Za-z0-9+/]?==)(?:&|\\z)"
                        ],
                        "transforms": [
                            "UrlDecode",
                            "Trim"
                        ]
                    }
                ],
                "skippedManagedRuleSets": [],
                "state": "Enabled"
            },
            {
                "name": "Java4ShellB64Header",
                "priority": 12,
                "ruleType": "MatchRule",
                "action": "Block",
                "matchConditions": [
                    {
                        "matchVariables": [
                            {
                                "variableName": "RequestHeaders"
                            }
                        ],
                        "operator": "Regex",
                        "negationConditon": false,
                        "matchValues": [
                            "\\A(?:(?i:Bearer|Basic)\\s+)?(?:(?:[A-Za-z0-9+\\/]{64})+(?:[A-Za-z0-9+\\/]{0,2}=|[A-Za-z0-9+\\/]?==)|(?:[A-Za-z0-9_-]+=*\\.)?(?:[A-Za-z0-9_-]+=*\\.)?(?:[A-Za-z0-9_-]{64})+(?:[A-Za-z0-9_-]{0,2}=|[A-Za-z0-9_-]?==)(?:\\.[A-Za-z0-9_-]+=*){0,2})\\z",
                            "(?:\\A|[^A-Za-z0-9+/])(?:[A-Za-z0-9+/]{64})+(?:[A-Za-z0-9+/]{0,2}=|[A-Za-z0-9+/]?==)(?:\\z|[^A-Za-z0-9+/=])"
                        ],
                        "transforms": []
                    }
                ],
                "skippedManagedRuleSets": [],
                "state": "Enabled"
            }
        ]

 

Published Nov 17, 2026
Version 1.0
No CommentsBe the first to comment