open5gs/lib
Sukchan Lee 234da30d93 core/sbi: Prevent DoS in requester-features parsing (uint64 overflow)
Replace strtoll() with strtoull() in ogs_uint64_from_string() and
remove fatal abort on conversion errors to prevent remote crash via
malformed SupportedFeatures/requester-features values.

The previous implementation could trigger OGS_LOG_FATAL and
ogs_assert_if_reached() when strtoll() detected ERANGE, allowing a
malicious or buggy peer to cause a denial-of-service by sending an
overly large hexadecimal value.

Changes:
- Use strtoull() for proper unsigned parsing.
- Add strict endptr validation (no digits, trailing garbage).
- Handle ERANGE and invalid inputs gracefully without abort().
- Normalize errno handling: success paths set errno=0.
- In ogs_sbi_parse_request(), reject invalid requester-features
  (EINVAL/ERANGE) and return OGS_ERROR instead of proceeding.

Empty string is treated as valid (0), consistent with 3GPP
SupportedFeatures pattern ('^[A-Fa-f0-9]*$').

This ensures malformed requester-features values no longer crash
NRF and are properly rejected during SBI request parsing.

Issues: #4263
2026-02-28 09:48:23 +09:00
..
app [MME] Add Emergency Number List to "Attach Accept" NAS message 2025-10-27 21:28:53 +09:00
asn1c [MME] unify TAU procedure handling and BCS check across all S1AP cases(#4112, #4113, #4117) 2025-10-25 21:31:45 +09:00
core core/sbi: Prevent DoS in requester-features parsing (uint64 overflow) 2026-02-28 09:48:23 +09:00
crypt clang scan-build static analysis findings/resolutions (#3387) 2024-08-16 16:42:12 +09:00
dbi Merge branch 'main' into home-routed 2025-04-06 18:37:36 +09:00
diameter [MME] S6a ULR: Add SMS-Register-Request AVP with SMS in MME Not Preferred 2026-02-25 22:34:31 +09:00
gtp Follow-up on #4220, #4221 2026-01-11 16:02:28 +09:00
ipfw pfcp/ipfw: Improve error handling in PDR creation/update and ipfw rule parsing 2025-11-20 16:39:17 +09:00
metrics [metrics] fix memory leak 2025-11-13 20:02:25 +09:00
nas Follow up on #4102 2025-10-27 21:31:21 +09:00
ngap [MME/AMF] Fixed crash following Handover Request (#3014) 2024-02-29 23:02:38 +09:00
pfcp core,gtp,pfcp,sgwc: avoid fatal asserts on pool and timer exhaustion 2025-12-30 11:49:40 +09:00
proto Fix DNN Operator-Identifier format and refactor OI parsing for HR roaming interop 2025-12-06 22:23:34 +09:00
s1ap [Release-17] Upgrade S1AP/NGAP to v17.3.9 2023-02-21 21:48:06 +09:00
sbi core/sbi: Prevent DoS in requester-features parsing (uint64 overflow) 2026-02-28 09:48:23 +09:00
sctp [PFCP] Refactor PFCP address handling (#3431) 2025-01-11 20:33:02 +09:00
tun [AMF] Follow-up on #3880 2025-06-17 17:34:18 +09:00
meson.build [SEPP] Initial Update for 5G Roaming (#2739) 2023-11-19 19:34:51 +09:00