A static analysis tool that spots security vulnerabilities in PostgreSQL extension scripts and SQL code.
pgspot is a static analysis tool that checks PostgreSQL SQL scripts for security vulnerabilities, specifically targeting extension scripts and security definer functions. It automates the detection of common attack vectors like search path manipulation and unsafe object creation to help developers follow PostgreSQL security best practices before deployment.
PostgreSQL extension developers, database administrators, and security engineers who write or review SQL scripts, particularly those creating extensions or security definer functions that require adherence to PostgreSQL security guidelines.
Developers choose pgspot because it proactively identifies security vulnerabilities that are easy to overlook in PostgreSQL code, offering configurable analysis for SQL-accepting functions and procedural languages, which helps prevent privilege escalation and injection attacks in a specialized domain.
Spot vulnerabilities in postgres SQL scripts
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Identifies vulnerabilities where attackers could inject malicious functions by manipulating search_path, directly addressing PostgreSQL security recommendations for extensions and security definer functions.
Flags the creation of tables, functions, or other objects without proper safeguards, such as PS012 for unsafe table creation, helping prevent privilege escalation.
Can be configured with --sql-accepting to unpack and evaluate SQL passed as string arguments to specific functions, uncovering hidden SQL execution that static analysis might miss.
Allows ignoring specific error codes or procedural languages using --ignore and --ignore-lang options, enabling tailored analysis to fit project needs and reduce noise.
Requires Python 3.10 and dependencies like pglast and libpg_query, which can complicate setup and maintenance compared to standalone binaries or native tools.
Exclusively analyzes PostgreSQL SQL scripts, making it ineffective for projects using other databases or mixed SQL dialects, limiting its utility in heterogeneous environments.
As a static tool, it may miss runtime vulnerabilities or dynamic SQL not captured by configuration, such as unconfigured SQL-accepting functions or evolving attack patterns.