Skip to content

security(spp_registry_search): corrupt search config parameter makes every search 500 [Severity: Low] #339

Description

@gonzalesedwin1123

Follow-up discovered during the staff review of the Registry Search server-side limits fix (PR #335). Deliberately left out of that PR's scope: the values are administrator-controlled, so this is robustness, not an attacker-reachable bypass.

Severity: Low (robustness / availability, admin-controlled trigger)

Problem

Both search_registrants and get_search_config in spp_registry_search/models/res_partner.py parse the search-governance config parameters with a bare int():

config_limit = max(10, min(200, int(get_param("spp_registry_search.result_limit", "50"))))
min_chars = max(1, min(10, int(get_param("spp_registry_search.min_chars", "3"))))

If an administrator sets a non-numeric value ("abc", "", "10.5") via the System Parameters UI (which does not validate these), int() raises ValueError:

  • every registry search RPC returns a generic 500 until the parameter is fixed, and
  • get_search_config fails during portal init (the JS catch silently falls back, masking the misconfiguration).

The res.config.settings fields write sane integers, but ir.config_parameter records can be edited directly.

Suggested fix

A small _get_int_param(name, default, lo, hi) helper used by both methods: int() in try/except (TypeError, ValueError) falling back to the default, then clamped. Optionally log a warning naming the bad parameter so the misconfiguration is visible. Tests: corrupt each parameter, assert search still works with defaults.

Origin

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions