open5gs/lib/gtp
Sukchan Lee 3c8178cff1 gtp2: Add runtime boundary validation in ogs_gtp2_parse_tft()
Replace ogs_assert() checks in ogs_gtp2_parse_tft() with explicit
runtime length validation to prevent process abort on malformed
TFT/TAD IEs.

Previously, insufficient length checks could trigger assertion
failures when parsing crafted BearerResourceCommand messages with
invalid packet filter content lengths. This allowed a malformed
TFT/TAD IE to cause a crash (SIGABRT) in SMF.

This patch:
- Adds explicit boundary checks before every field access
- Validates that content.length does not exceed remaining IE length
- Protects component array bounds during parsing
- Logs errors and returns current parsed size instead of aborting

The function now gracefully rejects malformed input without
terminating the process, preventing potential denial-of-service
conditions on S5-C interface.

No functional change for valid messages.

Issues: #4281
2026-02-28 22:17:00 +09:00
..
v1 ogs_fqdn_parse: Don't fail when parsing the empty APN 2024-08-25 09:42:48 +09:00
v2 gtp2: Add runtime boundary validation in ogs_gtp2_parse_tft() 2026-02-28 22:17:00 +09:00
context.c [SMF] If GTPU conf has advert addr, use it in up2cp FAR 2025-06-10 17:06:27 +09:00
context.h Initial metrics support based on Prometheus (#1571) 2022-06-08 05:51:02 +09:00
meson.build [NRF] Fixed library load error 2022-08-26 10:57:11 +09:00
ogs-gtp.h [NRF] Fixed library load error 2022-08-26 10:57:11 +09:00
path.c [HR] Implement GTP-U processing for HR Roaming in User Plane (#2194) 2024-11-23 17:51:42 +09:00
path.h Merge branch 'main' into home-routed 2025-06-17 17:34:46 +09:00
util.c [GTP] Incorrect destination TEID=0 (#3043) 2024-04-06 16:39:32 +09:00
util.h [GTP] Incorrect destination TEID=0 (#3043) 2024-04-06 16:39:32 +09:00
xact.c Follow-up on #4220, #4221 2026-01-11 16:02:28 +09:00
xact.h MME: handle EPS Bearer Context Status mismatch when active_flag=0 (#4112) 2025-10-16 21:46:38 +09:00