T-SQL code security
T-SQL static code analysis
Find security flaws in T-SQL stored procedures, functions and jobs: SQL and command injection, insecure GRANT usage, default accounts, hardcoded passwords and keys, weak cryptography and backdoors. T-SQL findings land in the same platform and report as the rest of your applications.
In short
DerScanner is a static application security testing (SAST) tool that scans T-SQL code. Its T-SQL rules are published in the DerScanner vulnerability database, and most of them map to CWE, OWASP Top 10 and PCI DSS 4.0.
The rules cover SQL injection, command injection through jobs, insecure GRANT usage, default and special accounts, hardcoded and empty passwords and keys, weak cryptography, and query errors such as incorrect NULL comparison and TOP without ORDER BY. Each finding comes with a severity, a description, a fix recommendation and the code location.
DerScanner runs on-premise, in air-gapped networks or in the cloud. For T-SQL it provides security analysis (SAST); PL/SQL has its own rules in the same platform.
What the T-SQL rules check
The T-SQL rules follow how database code is attacked: dynamic SQL built from input, rights granted too widely, and secrets kept in procedures. Each rule links to its description, CWE identifiers and fix recommendation.
Injection
SQL injection through dynamic SQL, code injection, command injection through jobs, and insecure functions.
- mediumSQL injection
- mediumCode injection
- mediumCommand injection (job)
- criticalInsecure function
Rights and accounts
GRANT statements that give too much, default accounts and special accounts left in the code.
- mediumInsecure GRANT usage
- mediumDefault account
- mediumUndocumented feature: special account
Secrets and cryptography
Passwords and keys written into procedures, empty keys, and weak encryption, hashing and random numbers.
- mediumHardcoded password
- mediumEmpty password
- mediumNull password
- mediumHardcoded encryption key
- criticalEmpty encryption key
- mediumNull encryption key
- criticalWeak encryption algorithm
- criticalWeak hashing algorithm
- criticalWeak random number generator
Backdoors and undocumented features
Hidden functionality, time bombs and unexpected network activity in database code.
Query errors and reliability
Incorrect comparison with NULL, TOP without ORDER BY, date conversion, empty error handling, denial of service and information leaks.
Other checks
- mediumCookie: broad path
- mediumCookie: broad domain
Where T-SQL code runs
T-SQL is the procedural SQL dialect used by SQL Server. Stored procedures, functions, triggers and jobs written in it often hold business logic that application code calls directly.
Database code sits next to the data and runs with database rights, so dynamic SQL, wide grants and stored secrets lead the rule list.
One scan with the rest of your code
T-SQL is one of 43 languages in DerScanner. Database code and the applications that call it can be scanned in the same platform, with one severity scale and one report format.
Scans run from the web interface, the CLI or a CI/CD integration, and the reports cover standards such as OWASP Top 10, PCI DSS and CWE.
Questions buyers ask about T-SQL static code analysis
DerScanner SAST scans T-SQL code with rules from its vulnerability database. They cover SQL injection, code injection, command injection through jobs, insecure GRANT usage, default accounts, hardcoded passwords and keys, weak cryptography and backdoor patterns. Each finding has a severity, a description, a fix recommendation and a code location.
Yes. The rule on insecure GRANT usage flags grants that give more rights than needed, and the rule Default account flags the use of default accounts. Each rule page in the vulnerability database explains the risk and how to fix it.
Yes. Each has its own rules in the vulnerability database, and both are among the 43 languages DerScanner scans, with one severity scale and one report format.
Most T-SQL rules list CWE identifiers and map to OWASP Top 10, OWASP ASVS and PCI DSS 4.0; some also map to HIPAA. The mapping is shown on each rule page in the vulnerability database.
Yes. DerScanner installs on-premise, including fully air-gapped networks, or runs in the cloud. Source code, scan results and reports stay on internal servers in an on-premise installation.
No. For T-SQL, DerScanner provides security analysis (SAST). Code quality analysis covers JavaScript, TypeScript, Delphi and Pascal. Some T-SQL rules do check query errors: incorrect comparison with NULL, TOP without ORDER BY and date conversion.
Yes. Request a free pilot on this page: the team gives you access and helps with the first scan. The pilot works in the cloud and on-premise.
Static analysis for other enterprise languages
Try DerScanner on your own code, free
Scan your own T-SQL code and see what DerScanner finds in it.
Request a free pilot. We give you access and help with the first scan. It works in the cloud and on-premise.
Want to describe your project first? Take the 2-minute PoC survey
Make Your Applications
Secure Today
Sign up for a personalized demo to see
how DerScanner can meet your Application Security needs

