{"id":"GHSA-h8cj-hpmg-636v","summary":"appsmith has SQL Injection in FilterDataService via Unsafe DROP TABLE Execution","details":"### Summary\nA SQL injection vulnerability exists in `FilterDataServiceCE.java` where the `dropTable` method constructs a SQL `DROP TABLE` statement using string concatenation with the table name. If the table name is derived from user input, this allows for arbitrary SQL command execution.\n\n### Details\nThe vulnerability is located in `app/server/appsmith-interfaces/src/main/java/com/appsmith/external/services/ce/FilterDataServiceCE.java`.\n\nLine 627 in `dropTable` method:\n```java\npublic void dropTable(String tableName) {\n    String dropTableQuery = \"DROP TABLE \" + tableName + \";\";\n    executeDbQuery(dropTableQuery);\n}\n```\n\nThe `tableName` argument is concatenated directly into the SQL string without validation or escaping.\n\n### PoC\nIf `dropTable` is exposed to user input (e.g., via a utility API that accepts a table name to clean up), an attacker could provide a value like:\n`valid_table; DROP TABLE users; --`\n\nThe resulting query would be:\n`DROP TABLE valid_table; DROP TABLE users; --;`\n\nThis would delete the intended table and then delete the `users` table (or execute any other injected SQL).\n\n### Impact\n*   **Type:** SQL Injection\n*   **Impact:** Data Loss (Drop Table), potentially Data Exfiltration or Modification depending on database permissions.\n*   **Who is impacted:** Appsmith server instances.","modified":"2026-05-05T16:07:07.369139Z","published":"2026-04-29T20:59:45Z","database_specific":{"severity":"HIGH","github_reviewed":true,"github_reviewed_at":"2026-04-29T20:59:45Z","nvd_published_at":null,"cwe_ids":["CWE-89"]},"references":[{"type":"WEB","url":"https://github.com/appsmithorg/appsmith/security/advisories/GHSA-h8cj-hpmg-636v"},{"type":"WEB","url":"https://github.com/appsmithorg/appsmith/commit/c8023ba4b3b54204ff3309c9e5c33664ad15ba32"},{"type":"PACKAGE","url":"https://github.com/appsmithorg/appsmith"}],"affected":[{"package":{"name":"com.appsmith:interfaces","ecosystem":"Maven","purl":"pkg:maven/com.appsmith/interfaces"},"ranges":[{"type":"ECOSYSTEM","events":[{"introduced":"0"},{"fixed":"1.99"}]}],"database_specific":{"last_known_affected_version_range":"\u003c= 1.98","source":"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/04/GHSA-h8cj-hpmg-636v/GHSA-h8cj-hpmg-636v.json"}}],"schema_version":"1.9.0","severity":[{"type":"CVSS_V3","score":"CVSS:3.1/AV:N/AC:L/PR:H/UI:N/S:U/C:H/I:H/A:H"}]}