Summary
loadProject() and ComponentLibrary::loadFile() catch parse errors but then perform unchecked typed access on well-formed JSON with wrong types (e.g. root["components"], cj["params"], j["type"].get<std::string>()), which can throw nlohmann::json exceptions outside the handled boundary.
Severity: Important (robustness / DoS)
Evidence
app/src/app.cpp loadProject() catches JSON parse errors only around in >> root, then does unchecked structured access.
app/src/component_library.cpp loadFile() catches only nlohmann::json::parse_error, then uses typed reads (j["type"].get<std::string>(), df["path"].get<std::string>()) without validating field types.
ComponentLibrary::scan() / refreshExtensions() don't wrap the later type conversions, so exceptions can escape the discovery boundary.
tests/test_project_file.cpp covers only syntactically invalid JSON, not wrong-type payloads.
Impact
A crafted .rfsim or component JSON with unexpected types can abort load/refresh unexpectedly and may terminate the app if the exception propagates out of the UI frame. Practical DoS path for untrusted project/library content.
Suggested fix
Validate schema/types before field extraction, catch nlohmann::json::exception around the full load path (not just parse), and add negative tests for wrong-type project and component payloads.
Summary
loadProject()andComponentLibrary::loadFile()catch parse errors but then perform unchecked typed access on well-formed JSON with wrong types (e.g.root["components"],cj["params"],j["type"].get<std::string>()), which can thrownlohmann::jsonexceptions outside the handled boundary.Severity: Important (robustness / DoS)
Evidence
app/src/app.cpploadProject()catches JSON parse errors only aroundin >> root, then does unchecked structured access.app/src/component_library.cpploadFile()catches onlynlohmann::json::parse_error, then uses typed reads (j["type"].get<std::string>(),df["path"].get<std::string>()) without validating field types.ComponentLibrary::scan()/refreshExtensions()don't wrap the later type conversions, so exceptions can escape the discovery boundary.tests/test_project_file.cppcovers only syntactically invalid JSON, not wrong-type payloads.Impact
A crafted
.rfsimor component JSON with unexpected types can abort load/refresh unexpectedly and may terminate the app if the exception propagates out of the UI frame. Practical DoS path for untrusted project/library content.Suggested fix
Validate schema/types before field extraction, catch
nlohmann::json::exceptionaround the full load path (not just parse), and add negative tests for wrong-type project and component payloads.