Skip to content

[MEDIUM] Full SQL queries logged including sensitive data #193

Description

@pradeepto

Description

pkg/snowflake/client.go:83-87 and :124-127

Both query() and execute() functions log the full SQL query text as a structured log value:

logger := log.FromContext(ctx).WithValues(
    "role", role,
    "secondaryRole", "NONE",
    "query", sqlQuery,  // full query text logged
)

executeBatch() at line 162 does the same for each query in the batch.

Impact

All SQL queries including file paths, database names, stage names, and any data embedded in queries are visible in controller logs. If the SQL injection vulnerability (issue #169) is exploited the injected payloads also appear in logs.

Fix

Log a query type identifier instead of the full text:

logger := log.FromContext(ctx).WithValues(
    "role", role,
    "queryType", extractQueryType(sqlQuery), // e.g. "PUT", "SELECT", "REMOVE"
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingsecurity-fix-requiredSecurity vulnerability that needs fixing

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions