NixOS / hydra

Hydra, the Nix-based continuous build system
http://nixos.org/hydra
GNU General Public License v3.0
1.1k stars 291 forks source link

Insufficient validation on HTTP /eval endpoint: serves 500s #1238

Open trofi opened 2 years ago

trofi commented 2 years ago

Describe the bug

500-ed hydra by trying a string named eval ID: https://hydra.nixos.org/eval/nixpkgs:staging-next?compare=trunk&full=1#tabs-now-fail.

500 Internal Server Error
DBIx::Class::Storage::DBI::_dbh_execute(): DBI Exception: DBD::Pg::st execute failed: ERROR: invalid input syntax for type integer: "nixpkgs:staging-next"
CONTEXT: unnamed portal parameter $1 = '...' [for Statement "SELECT me.id, me.jobset_id, me.evaluationerror_id, me.timestamp, me.checkouttime, me.evaltime, me.hasnewbuilds, me.hash, me.nrbuilds, me.nrsucceeded, me.flake, me.nixexprinput, me.nixexprpath FROM jobsetevals me WHERE ( me.id = ? )" with ParamValues: 1='nixpkgs:staging-next'] at /nix/store/3zr3a83bgj2jxhy59pyvxhxgnb640ici-hydra-0.1.20220409.7b7e059/libexec/hydra/lib/Hydra/Controller/JobsetEval.pm line 16

Hydra Server:

Hydra 0.1.20220409.7b7e059 (using nix-2.8.0pre20220405_5fe4fe8).

Additional context Add any other context about the problem here.