cbcvebase.
CVE-2023-5044
published 2023-10-25

CVE-2023-5044: Code injection via nginx.ingress.kubernetes.io/permanent-redirect annotation.

PriorityP267high8.8CVSS 3.1
AVNACLPRLUINSUCHIHAH
EPSS
56.57%
98.9th percentile
Code injection via nginx.ingress.kubernetes.io/permanent-redirect annotation.

Affected

2 ranges
VendorProductVersion rangeFixed in
k8s.ioingress-nginx>= 0 < 1.9.01.9.0
kubernetesingress-nginx< 1.9.01.9.0

Detection & IOCsextracted from sources · hover to see the quote

snort
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"ET WEB_SERVER Kubernetes Ingress NGINX Controller configuration-snippet Annotation Injection (CVE-2023-5044)"; flow:established,to_server; http.method; content:"POST"; http.content_type; content:"application/json"; http.request_body; content:"|22|admission.k8s.io/v1|22 2c|"; content:"|22|nginx.ingress.kubernetes.io/configuration-snippet|22 3a|"; fast_pattern; pcre:"/^\s*?\x22[^\x2c]*?(?:content_by_lua|\x23|\x3b\x7d)/R"; reference:url,github.com/r0binak/CVE-2023-5043; reference:cve,2023-5044; classtype:web-application-attack; sid:2061121; rev:1; metadata:affected_product Kubernetes, attack_target Server, tls_state TLSDecrypt, created_at 2025_03_27, cve CVE_2023_5044, deployment Perimeter, deployment Internal, deployment SSLDecrypt, confidence High, signature_severity Major, tag Exploit, updated_at 2025_03_27, mitre_tactic_id TA0001, mitre_tactic_name Initial_Access, mitre_technique_id T1190, mitre_technique_name Exploit_Public_Facing_Application; target:dest_ip;)
snort
alert http $EXTERNAL_NET any -> $HOME_NET any (msg:"ET WEB_SERVER Kubernetes Ingress NGINX Controller permanent-redirect Annotation Injection (CVE-2023-5044)"; flow:established,to_server; http.method; content:"POST"; http.content_type; content:"application/json"; http.request_body; content:"|22|admission.k8s.io/v1|22 2c|"; content:"|22|nginx.ingress.kubernetes.io/permanent-redirect|22 3a|"; fast_pattern; pcre:"/^\s*?\x22[^\x22]*?(?:\\n|[\x23\x3b])/R"; reference:url,raesene.github.io/blog/2023/10/29/exploiting-CVE-2023-5044/; reference:cve,2023-5044; classtype:web-application-attack; sid:2061120; rev:1; metadata:affected_product Kubernetes, attack_target Server, tls_state TLSDecrypt, created_at 2025_03_27, cve CVE_2023_5044, deployment Perimeter, deployment Internal, deployment SSLDecrypt, signature_severity Major, tag Exploit, updated_at 2025_03_27, mitre_tactic_id TA0001, mitre_tactic_name Initial_Access, mitre_technique_id T1190, mitre_technique_name Exploit_Public_Facing_Application; target:dest_ip;)
  • Exploit traffic targets the Kubernetes admission webhook endpoint via HTTP POST with Content-Type application/json; look for the admission API version string 'admission.k8s.io/v1' in the request body alongside the malicious annotation key.
  • For the permanent-redirect injection vector, detect POST requests to the admission webhook containing 'nginx.ingress.kubernetes.io/permanent-redirect' annotation values that include newline (\n), '#' (0x23), or ';' (0x3b) characters — these are used to break out of the redirect value and inject arbitrary NGINX config directives.
  • For the configuration-snippet injection vector, flag annotation values containing Lua execution via 'content_by_lua', comment characters '#' (0x23), or block-closing sequences ';}' (0x3b 0x7d) which are used to escape the snippet context and inject arbitrary directives.
  • Both attack vectors arrive as HTTP POST with Content-Type application/json directed at the ingress-nginx admission controller; deploy detection on both perimeter and internal segments, and on TLS-decrypting inspection points.
  • Code injection via nginx.ingress.kubernetes.io/permanent-redirect annotation is the primary described attack surface for CVE-2023-5044.
  • ·Both Snort rules require TLS decryption (tls_state TLSDecrypt) to inspect the admission webhook request body; without SSL/TLS inspection in-line, the rules will not fire on encrypted traffic.
  • ·The rules are scoped to HTTP POST traffic from EXTERNAL_NET to HOME_NET — ensure the Kubernetes admission controller endpoint is reachable from the monitored network segment and that HOME_NET is correctly defined to include the cluster's API server/admission webhook address.
Stop checking back — get the weekly exploitation signal.

Every Monday: what got weaponized or added to CISA KEV in the last seven days — each CVE cross-linked to its PoC, Nuclei template, and detection rule. Free, one email a week, unsubscribe in one click.