{"id":"GHSA-2p5p-m353-833w","summary":"Sort order SQL injection in Administrate","details":"In Administrate (rubygem) before version 0.13.0, when sorting by attributes on a dashboard,\nthe direction parameter was not validated before being interpolated into the SQL query.\nThis could present a SQL injection if the attacker were able to modify the `direction` parameter and bypass ActiveRecord SQL protections.\n\nWhilst this does have a high-impact, to exploit this you need access to the Administrate dashboards, which we would expect to be behind authentication.\n\nThis is patched in wersion 0.13.0.","aliases":["CVE-2020-5257"],"modified":"2026-07-08T06:28:12.832132300Z","published":"2020-03-13T21:05:44Z","database_specific":{"github_reviewed_at":"2020-03-13T21:05:20Z","nvd_published_at":null,"cwe_ids":["CWE-943"],"severity":"HIGH","github_reviewed":true},"references":[{"type":"WEB","url":"https://github.com/thoughtbot/administrate/security/advisories/GHSA-2p5p-m353-833w"},{"type":"ADVISORY","url":"https://nvd.nist.gov/vuln/detail/CVE-2020-5257"},{"type":"WEB","url":"https://github.com/thoughtbot/administrate/commit/3ab838b83c5f565fba50e0c6f66fe4517f98eed3"},{"type":"ADVISORY","url":"https://github.com/advisories/GHSA-2p5p-m353-833w"},{"type":"WEB","url":"https://github.com/rubysec/ruby-advisory-db/blob/master/gems/administrate/CVE-2020-5257.yml"}],"affected":[{"package":{"name":"administrate","ecosystem":"RubyGems","purl":"pkg:gem/administrate"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"0.13.0"}]}],"versions":["0.0.10","0.0.11","0.0.12","0.0.2","0.0.3","0.0.4","0.0.6","0.0.7","0.0.8","0.0.9","0.1.0","0.1.1","0.1.2","0.1.3","0.1.4","0.1.5","0.10.0","0.11.0","0.12.0","0.2.0","0.2.0.rc1","0.2.1","0.2.2","0.3.0","0.4.0","0.5.0","0.6.0","0.7.0","0.8.0","0.8.1","0.9.0"],"database_specific":{"source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2020/03/GHSA-2p5p-m353-833w/GHSA-2p5p-m353-833w.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N"}]}