Orm raw query

From zakirkun/ice-tea · View interactive version

Orm raw query is an AI agent skill from the GitHub repository zakirkun/ice-tea. Detects raw SQL queries embedded within ORM frameworks that bypass parameterization, reintroducing SQL injection risk.

How to use this skill

Skill file

ORM Raw Query Injection

Overview

ORM frameworks like SQLAlchemy, Hibernate, Sequelize, and GORM provide parameterized query builders that prevent SQL injection. However, they also expose raw(), execute(), and query() escape hatches that, when used with string concatenation or f-strings, reintroduce SQL injection vulnerabilities.

Remediation

Use the ORM's parameterized query API instead of raw query methods.

Vulnerable (Python/SQLAlchemy):

db.execute(f"SELECT * FROM users WHERE username = '{username}'")

Safe (Python/SQLAlchemy):

db.execute(text("SELECT * FROM users WHERE username = :username"), {"username": username})
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.