Operational: Config YAML loader has no validation of critical fields #91

Open
opened 2026-05-11 13:48:53 +00:00 by thabeta · 0 comments
Owner

Severity: Medium

Location

crates/hero_aibroker_lib/src/registry/loader.rs and registry/types.rs

Finding

The config loader deserializes YAML directly into structs with no validation:

let config: ModelsConfig = serde_yaml::from_str(&content)?;
  • No validation that provider names match registered providers
  • No validation that model aliases are unique
  • No validation of priority values
  • No validation of endpoint URLs
  • Invalid configs load silently and fail at runtime

Recommendation

  • Add a validate() method on all config types
  • Check provider references at load time
  • Validate URL formats
  • Return structured validation errors with field paths
## Severity: Medium ## Location `crates/hero_aibroker_lib/src/registry/loader.rs` and `registry/types.rs` ## Finding The config loader deserializes YAML directly into structs with no validation: ```rust let config: ModelsConfig = serde_yaml::from_str(&content)?; ``` - No validation that provider names match registered providers - No validation that model aliases are unique - No validation of priority values - No validation of endpoint URLs - Invalid configs load silently and fail at runtime ## Recommendation - Add a `validate()` method on all config types - Check provider references at load time - Validate URL formats - Return structured validation errors with field paths
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_aibroker#91
No description provided.