Solutions/By stack
AppSec for PL/SQL
Oracle packages, procedures and triggers are checked together with the rest of the application code.
PROCEDURE find(p_name IN VARCHAR2) IS
v_sql := 'SELECT … WHERE name = ''' || p_name || '''';
EXECUTE IMMEDIATE v_sql;
SQL injection in dynamic SQL
01PL/SQL
How to load code
- Archive or GitLab
- Oracle code files: .sql, .pks, .pkb, .trg.
- What the platform sees
- Packages, procedures, functions, triggers and views, by schema.
- Secrets in scripts
- Login and password in CONNECT, IDENTIFIED BY, sqlplus strings and EZConnect.
02Rules
What SAST finds in PL/SQL code
- SQL injection in dynamic SQL
- Caller's command run with the code owner's privileges
- OS command from the caller's data
- Constant encryption key in a DBMS_CRYPTO call
- Weak hash: MD5, SHA-1, HMAC-MD5
- Password as an API argument or in DDL text
- VPD policy disabled from code
- Audit disabled from code
- Privilege granted to PUBLIC
- Excessive system privilege