🇰🇷 한글 설명
NGINX JavaScript(njs)의 XML 모듈 내 네임스페이스 접두사 목록 파서에서 경계 외 쓰기(Out-of-bounds write) 취약점이 발견되었습니다. 공격자가 조작된 XML 데이터를 전송할 경우 NGINX 워커 프로세스가 충돌하거나 메모리 누수가 발생하여 서비스 거부(DoS) 상태에 빠질 수 있습니다.
💡 쉬운 설명
NGINX에서 사용하는 자바스크립트 엔진의 XML 처리 과정에 오류가 있어, 나쁜 의도를 가진 데이터가 들어오면 서버가 멈추거나 메모리가 계속 쌓여 느려질 수 있습니다. 특히 SAML 인증을 사용하는 환경에서 인증되지 않은 공격자가 이를 악용할 수 있습니다.
🇺🇸 원문 (English)
Description
NGINX JavaScript (njs) has a vulnerability in the XML module's namespace prefix list parser, reachable through the xml.exclusiveC14n() method. An unauthenticated remote attacker can trigger it when an affected NGINX configuration passes an externally controlled XML namespace prefix list to that method. Both the njs and the QuickJS (qjs) engines are affected. A crafted prefix list causes an out-of-bounds write past the end of a heap allocation. With the njs engine, which is the engine used when the js_engine directive is absent, this corrupts adjacent objects and crashes the NGINX worker. With the QuickJS engine, the same call additionally leaks the prefix list on every invocation, causing worker memory to grow across requests. The official nginxinc/nginx-saml reference implementation is affected during SAML signature verification. It reads InclusiveNamespaces/@PrefixList from an untrusted SAML message and passes it to xml.exclusiveC14n() before the signature has been verified, so a valid SAML signature is not required. A crafted SAML Response, Assertion, LogoutRequest, or LogoutResponse is sufficient. Code execution has not been demonstrated and cannot be ruled out for all platforms, as the effect of the out-of-bounds write depends on conditions beyond the attacker's control.
Impact
This vulnerability allows remote attackers to cause a denial of service on the NGINX system, either through repeatable worker restarts or through worker memory growth or possibly trigger code execution. There is no control plane exposure; this is a data plane issue only.
Note: Software versions which have reached End of Technical Support (EoTS) are not evaluated.
📍 영향받는 시스템
NGINX JavaScript (njs) 및 QuickJS 엔진을 사용하는 NGINX 환경 (nginxinc/nginx-saml 포함)
⚔️ 공격 벡터
조작된 XML 네임스페이스 접두사 목록을 포함한 SAML 메시지(Response, Assertion 등)를 전송하여 공격
🛡️ 대응 방법
njs 및 관련 모듈을 최신 보안 패치가 적용된 버전으로 업데이트하고, SAML 검증 전 외부 입력을 신뢰하지 않도록 설정 확인
🔧 검증 코드
출력 결과에서 njs 모듈의 설치 여부와 버전을 확인하여 취약한 버전인지 대조합니다.
nginx -V 2>&1 | grep -i 'njs'