mirror of
https://github.com/open5gs/open5gs.git
synced 2026-04-28 03:19:31 +00:00
The AMF could abort when processing malformed or oversized multipart SBI requests due to an assertion triggered in the multipart parser callback. When the parser encountered an overflow condition while assembling multipart part data, `on_part_data()` executed `ogs_assert_if_reached()`, causing the AMF process to terminate. This allowed malformed HTTP/2 multipart requests to trigger a denial-of-service condition. This patch replaces the assertion-based failure with graceful error handling: - Introduce `multipart_part_data_t` and explicit parser state tracking. - Add `parse_error` flag to propagate parsing failures. - Validate the result of `multipart_parser_execute()`. - Reject malformed multipart payloads instead of aborting. - Replace fatal assertions with error handling and proper cleanup. - Add centralized cleanup via `multipart_parser_data_free()`. As a result, malformed or oversized multipart bodies are now rejected with an error, while the AMF process remains operational. Issues: #4290 |
||
|---|---|---|
| .. | ||
| app | ||
| asn1c | ||
| core | ||
| crypt | ||
| dbi | ||
| diameter | ||
| gtp | ||
| ipfw | ||
| metrics | ||
| nas | ||
| ngap | ||
| pfcp | ||
| proto | ||
| s1ap | ||
| sbi | ||
| sctp | ||
| tun | ||
| meson.build | ||