React Server Components高危漏洞(CVE-2025-66478)深度解析与AWS WAF防护实战

本文详细分析了影响React Server Components的远程代码执行漏洞CVE-2025-66478,提供了受影响的React 19.x及Next.js 15-16版本的修复方案,并给出了完整的AWS WAF自定义规则配置,用于检测和拦截针对此漏洞的攻击。

CVE-2025-66478: React Server Components中的RCE漏洞

发布日期: 2025/12/03 19:45 PM PST

描述:

AWS已获悉近期披露的CVE-2025-55182,该漏洞影响React 19.0、19.1和19.2版本中的React Server Flight协议,以及在使用App Router的Next.js 15.x、16.x、Next.js 14.3.0-canary.77及更高canary版本中。此问题可能允许在受影响的应用程序服务器上执行未经授权的远程代码(RCE)。 AWS已获悉CVE-2025-66478,该漏洞已被认定为CVE-2025-55182的重复项。

影响与修复:

使用AWS托管服务的客户不受影响,无需采取任何措施。在自有环境中运行受影响版本React或Next.js的客户应立即更新到最新的已修补版本:

  • 使用React 19.x(含Server Functions和RSC Components)的客户应更新至已修补的最新版本:19.0.119.1.219.2.1
  • 使用带App Router的Next.js 15-16的客户应更新至已修补的版本。

AWS WAF防护措施:

默认版本(1.24)的AWS WAF “AWSManagedRulesKnownBadInputsRuleSet” 现已包含针对此问题的更新规则。作为临时保护措施,客户可以在适用的情况下部署自定义AWS WAF规则来帮助检测和防止利用尝试。请参见下文“添加自定义AWS WAF规则”。

AWS正在积极监控此问题的更新。如果您需要更多详细信息或帮助,请创建AWS支持案例。

添加自定义AWS WAF(Web应用程序防火墙)规则

为了针对此问题实施深度防御,您可以部署自定义的AWS WAF规则。以下AWS WAF规则当前设置为BLOCK模式。我们建议测试此自定义规则,以确保它不会对您的环境造成中断。

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
{
  "Name": "ReactJSRCE_CUSTOM",
  "Priority": 99,
  "Statement": {
    "AndStatement": {
      "Statements": [
        {
          "RegexMatchStatement": {
            "RegexString": "POST",
            "FieldToMatch": {
              "Method": {}
            },
            "TextTransformations": [
              {
                "Priority": 0,
                "Type": "NONE"
              }
            ]
          }
        },
        {
          "RegexMatchStatement": {
            "RegexString": "(?i)(?:next-action|rsc-action-id)",
            "FieldToMatch": {
              "Headers": {
                "MatchPattern": {
                  "All": {}
                },
                "MatchScope": "KEY",
                "OversizeHandling": "CONTINUE"
              }
            },
            "TextTransformations": [
              {
                "Priority": 0,
                "Type": "NONE"
              }
            ]
          }
        },
        {
          "RegexMatchStatement": {
            "RegexString": "(?i)\"status\"\\s*:\\s*\"resolved_model\"",
            "FieldToMatch": {
              "Body": {
                "OversizeHandling": "CONTINUE"
              }
            },
            "TextTransformations": [
              {
                "Priority": 0,
                "Type": "URL_DECODE_UNI"
              },
              {
                "Priority": 1,
                "Type": "JS_DECODE"
              },
              {
                "Priority": 2,
                "Type": "UTF8_TO_UNICODE"
              }
            ]
          }
        },
        {
          "RegexMatchStatement": {
            "RegexString": "\\$\\@",
            "FieldToMatch": {
              "Body": {
                "OversizeHandling": "CONTINUE"
              }
            },
            "TextTransformations": [
              {
                "Priority": 0,
                "Type": "URL_DECODE_UNI"
              },
              {
                "Priority": 1,
                "Type": "JS_DECODE"
              },
              {
                "Priority": 2,
                "Type": "UTF8_TO_UNICODE"
              }
            ]
          }
        }
      ]
    }
  },
  "Action": {
    "Block": {}
  },
  "RuleLabels": [
    {
      "Name": "ReactJSRCE_Custom"
    }
  ],
  "VisibilityConfig": {
    "SampledRequestsEnabled": true,
    "CloudWatchMetricsEnabled": true,
    "MetricName": "ReactJS_Custom"
  }
}

如有任何安全问题或疑虑,请发送电子邮件至 aws-security@amazon.com

comments powered by Disqus
使用 Hugo 构建
主题 StackJimmy 设计