Improve the Security of your Oracle PL/SQL code

Visual Expert helps improve the security of your Oracle database and PL/SQL code, by working on several levels:

  • It detects vulnerabilities in PL/SQL code.
  • It helps reduce the potential attack surface by listing dead or obsolete code.
  • It identifies bad practices or inefficient code, for example, to optimize performance and make denial-of-service (DoS) attacks more difficult.
  • For each issue identified, Visual Expert can propose modifications to fix it.

Below is a list of the most relevant security scanning rules for Oracle environments:

  1. SQL Injection
  2. Command Injection
  3. Cryptographic Failures
  4. Security Misconfiguration
  5. Vulnerable and Outdated Components
  6. Dead or Unused Code
  7. Empty Methods or Blocks
  8. Improper Exception Handling
  9. Insufficient Logging and Monitoring

SQL Injection

Description
Detects dynamically constructed SQL queries that incorporate external input without sanitization, especially within EXECUTE IMMEDIATE statements.

Impact
Unvalidated inputs in SQL queries can be exploited to manipulate the query structure, bypass authentication, or extract unauthorized data.

Recommendation
Use bind variables whenever possible, and sanitize all user input before using it in dynamic SQL.

Visual Expert Rule(s)

Command Injection

Description
Flags use of dynamic OS command execution where command strings are built from external input.

Impact
Unsanitized inputs may allow an attacker to execute arbitrary commands on the host system.

Recommendation
Avoid constructing shell commands from user data.
Use white-listed commands and validate all parameters.

Visual Expert Rule(s)

Cryptographic Failures

Description
Identifies the use of insecure algorithms or cryptographic packages like DES, 3DES, SHA-1, or outdated Oracle packages.

Impact
Weak algorithms can compromise the confidentiality or integrity of data.

Recommendation
Use modern algorithms (e.g., AES, SHA-256) and avoid deprecated packages such as DBMS_OBFUSCATION_TOOLKIT.

Visual Expert Rule(s)

Security Misconfiguration

Description
Detects use of potentially risky Oracle features or statements, such as DBMS_OUTPUT.PUT_LINE in production or SYS-owned objects.

Impact
Such usage may expose sensitive data or bypass proper access controls.

Recommendation
Avoid exposing internal output in production and restrict usage of privileged packages.

Visual Expert Rule(s)

Vulnerable and Outdated Components

Description
Flags the usage of deprecated or desupported Oracle features and packages.

Impact
Older components may no longer receive security updates and can be incompatible with current best practices.

Recommendation
Refactor code to use supported and secure alternatives.

Visual Expert Rule(s)

Dead or Unused Code

Description
Identifies procedures, functions, and packages that are no longer used or referenced.

Impact
Dead code increases the attack surface and may conceal vulnerabilities.

Recommendation
Remove unused code to simplify maintenance and reduce exposure.

Visual Expert Rule(s)

Empty Methods or Blocks

Description
Flags procedures or functions that are declared but contain no executable code.

Impact
Empty logic may indicate incomplete development or unused functionality that should be removed.

Recommendation
Clean up empty code blocks unless they serve a documented interface purpose.

Visual Expert Rule(s)

Improper Exception Handling

Description
Detects exception blocks that ignore or inadequately log errors, including generic WHEN OTHERS THEN NULL.

Impact
Suppressing exceptions leads to poor traceability and may conceal functional or security flaws.

Recommendation
Always log or handle exceptions in a meaningful and traceable way.

Visual Expert Rule(s)

Insufficient Logging and Monitoring

Description
Detects lack of audit trails or logging in critical code areas, especially in exception flows.

Impact
Insufficient monitoring limits the ability to detect and investigate incidents.

Recommendation
Implement meaningful logging for key operations and exceptions.

Visual Expert Rule(s)

For the full list of Oracle-specific code inspection rules, please refer to the Visual Expert Code Rules.

Security Scanning Rules for Oracle PLSQL Code

 

Visual Expert, Oracle, PL/SQL Code Security Scanning, Code Security Rules, Vulnerability Assessment