Skip to content

🚨 CRITICAL: Oracle Security Fix - Remove Default Paths - #7

Merged
samscarrow merged 1 commit into
mainfrom
fix/critical-security-oracle-password
Aug 18, 2025
Merged

🚨 CRITICAL: Oracle Security Fix - Remove Default Paths#7
samscarrow merged 1 commit into
mainfrom
fix/critical-security-oracle-password

Conversation

@samscarrow

Copy link
Copy Markdown
Collaborator

🔒 Critical Security Fix

This PR addresses security vulnerabilities in the Oracle database configuration by removing all default paths and enforcing environment variable usage.

Security Issues Fixed

  1. Removed default paths that exposed system structure:

    • /home/sam/git/photosight/wallet (exposed username and project structure)
    • /usr/lib (exposed system architecture)
  2. Enforced environment variables for all sensitive configuration

  3. Added validation to fail fast if required variables are missing

Changes

  • Remove all default values for paths in Oracle configuration
  • Add validate_config() method to check required environment variables
  • Call validation before any connection attempt
  • Provide clear error messages when configuration is incomplete

Breaking Changes

Oracle connection now requires these environment variables:

  • ORACLE_USER
  • ORACLE_PASSWORD
  • ORACLE_TNS_ADMIN
  • ORACLE_CLIENT_PATH

Migration Guide

Set the following in your .env file:

ORACLE_USER=your_user
ORACLE_PASSWORD=your_password
ORACLE_TNS_ADMIN=/path/to/wallet
ORACLE_CLIENT_PATH=/path/to/oracle/client

Testing

  • Verify connection fails with clear error when env vars are missing
  • Verify connection succeeds when all env vars are set
  • No sensitive data in error messages

⚠️ This is a critical security fix and should be merged immediately.

…s for Oracle config

- Remove hardcoded default paths that exposed system structure
- Enforce all sensitive configuration via environment variables
- Add validation to fail fast if required env vars are missing
- No defaults for WALLET_PATH, TNS_ADMIN, or CLIENT_PATH

Security improvements:
- All Oracle configuration now requires explicit environment variables
- Validation ensures config is complete before attempting connection
- Clear error messages guide users to set required variables

BREAKING CHANGE: Oracle connection now requires these environment variables:
- ORACLE_USER
- ORACLE_PASSWORD
- ORACLE_TNS_ADMIN
- ORACLE_CLIENT_PATH
Copilot AI review requested due to automatic review settings August 18, 2025 00:58
@github-actions

Copy link
Copy Markdown

🤖 Claude Code Review Error

Sorry, I encountered an error while reviewing this PR:

Please check the workflow logs for more details.

@github-actions

Copy link
Copy Markdown

Claude Code Review Failed: Please check the workflow logs for details.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR implements a critical security fix for Oracle database configuration by removing hardcoded default paths that exposed sensitive system information and enforcing the use of environment variables for all configuration values.

  • Removed hardcoded default paths that exposed username, project structure, and system architecture
  • Added validation method to ensure all required environment variables are set before connection attempts
  • Enforced environment variable usage for Oracle client path, TNS admin path, and wallet configuration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

os.environ['TNS_ADMIN'] = cls.TNS_ADMIN
# Ensure TNS_ADMIN is set in environment if available
if cls.TNS_ADMIN:
os.environ['TNS_ADMIN'] = cls.TNS_ADMIN

Copilot AI Aug 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This condition check creates inconsistent behavior. The validate_config() method requires TNS_ADMIN to be set (line 40-41), but this line only sets the environment variable if it exists. This means the validation will fail if TNS_ADMIN is missing, but the connection code assumes it might be optional.

Suggested change
os.environ['TNS_ADMIN'] = cls.TNS_ADMIN
# Ensure TNS_ADMIN is set in environment (guaranteed by validation)
os.environ['TNS_ADMIN'] = cls.TNS_ADMIN

Copilot uses AI. Check for mistakes.

# Ensure TNS_ADMIN is set in environment
os.environ['TNS_ADMIN'] = cls.TNS_ADMIN
# Ensure TNS_ADMIN is set in environment if available

Copilot AI Aug 18, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comment 'if available' is misleading since the validate_config() method now requires TNS_ADMIN to be set. The comment should reflect that this is a required configuration, not optional.

Suggested change
# Ensure TNS_ADMIN is set in environment if available
# Ensure TNS_ADMIN is set in environment (required)

Copilot uses AI. Check for mistakes.
@samscarrow
samscarrow merged commit 7c9e9d6 into main Aug 18, 2025
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants