The vulnerability is an infinite loop in the fio_json_parse function, located in the header file lib/facil/fiobj/fio_json_parser.h. The root cause is the failure to check if the file pointer advances after attempting to parse a number. When the parser encounters a standalone 'i' or 'I' (for infinity), the fio_atol function returns without advancing the pointer, but the loop condition does not account for this, causing it to repeat indefinitely.
The patch, found in commit 5128747363055201d3ecf0e29bf0a961703c9fa0, rectifies this by adding a tmp == pos check to ensure progress is made during parsing.
Since fio_json_parse is a static inline function, its code is compiled directly into the calling functions. The vulnerability description and PoC identify several such functions that act as entry points to the vulnerable code:
- In
facil.io, fiobj_json2obj and fiobj_hash_update_json are public APIs that call the vulnerable parser. A runtime profiler would show these functions consuming excessive CPU during an attack.
- In the downstream
iodine Ruby gem, which vendors the affected code, the Iodine::JSON.parse method is the entry point. This method calls a C function that uses the same vulnerable parser.
Therefore, all these functions are listed as vulnerable. fio_json_parse contains the flawed logic, while the others are the functions that would appear in a runtime profile when the vulnerability is triggered, making them critical indicators for exploitation.