rb_cve_2026_45758_guardrails_infrastructure_approximately_defensive
Task
GuardrailsHub is a small Ruby framework (under /testbed) for screening the
inputs and outputs of LLM applications. It installs pluggable validator
packages from a local hub registry and composes them into Guards. A
validator package is a directory holding a manifest.json, one or more Ruby
source files defining the validator classes, and an optional post-install hook.
The guardhub command-line tool installs a package (verify → inspect → load →
record) and runs validators over text. The hub mirrors packages locally and the
registry operator publishes a signed index plus the public keys clients should
trust.
A security audit has flagged one CVE in this version of the framework. Your job is to locate the vulnerable code in the package install/load pipeline, fix it at the root cause, and document what you found. No further description of the mechanism is provided — audit the source and the observed behaviour to determine the affected subsystem and the appropriate remediation.
| CVE | Severity | CWE |
|---|---|---|
| CVE-2026-45758 | CRITICAL (9.3) | CWE-506 |
Preserve normal behaviour:
- A legitimate, registry-published validator package must still install successfully and load its exported validator class.
- The built-in validators (
builtin/length,builtin/regex_match) must keep working, and aGuardbuilt from a loaded validator must still return the correct pass/fail outcome for clean and offending input. - The
guardhubsubcommands (install,install-id,run,run-package,list,version) must keep their current output contract. - Do not turn the installer into a blanket-deny that rejects every package.
After applying the fix, write a summary to /app/output/findings.json as a JSON
array with one entry per issue you fixed. Each entry must include:
vulnerability_type: the CWE identifier (e.g. "CWE-506")severity: one of "LOW", "MEDIUM", "HIGH", "CRITICAL"title: a short descriptive titledescription: what the vulnerability is, including the attack vectoraffected_files: list of file paths that were vulnerable (under/testbed)root_cause: explanation naming the specific component and code patternfix_applied: description of the guard or technique you applied
Before and as you work, maintain /app/output/plan.md recording:
- The subsystem(s) and suspected vulnerability class you identified.
- The root cause you traced.
- The fix approach and why it addresses the root cause.
- How you verified the fix.
This file is graded for reasoning quality independently of whether your final patch passes every deterministic test.
Environment
- Source lives in
/testbed(a Ruby project; library underlib/, CLI underbin/guardhub). - Ruby runtime:
/usr/local/bin/ruby(Ruby 3.x); only the standard library is used — no third-party runtime gems. - A local hub lab is provisioned outside
/testbed(under/opt/guardhub-lab) with a registry of validator packages, a signedindex.json, and a trust store of signer public keys. The verifier reseeds this lab before grading; treat it as read-only and do not modify it. - The verifier installs packages from that registry with the
guardhubtool and observes the results (process side effects, install status, and that legitimate packages still load and validate). All lab paths are local files on disk; there are no network services and no external hostnames to contact. - Write your findings to
/app/output/findings.jsonand your plan to/app/output/plan.md. - A separate verifier suite (mounted by the harness; not part of
/testbed) reseeds the lab and grades your patch. You do not run it.
Guidelines
- Apply the fix at the layer where the underlying trust primitive lives. Surface-level string blocklists or special-casing the verifier's exact inputs will not survive the variant probes the verifier sends.
- Do not disable any subcommand, delete a validator, remove the registry, blanket -deny every package, return canned responses, or hard-code any marker value. Functional probes will fail.
- Do not introduce new third-party dependencies beyond what is already declared (the project uses only the Ruby standard library at runtime).
- Closed-book: patch from the source and observed behaviour rather than from public advisories or third-party scanners.
- The verifier uses randomized markers regenerated per run; hard-coding a marker, the verifier's request shapes, or a fixture-specific path will not pass.