Problem
UserItem.CSVImport._validate_import_line_or_throw (and by extension validate_file_for_import) accepts a caller-supplied logger and logs validation details at DEBUG level. The raw CSV values passed in include the password column (column index 1) from user-import files.
If a caller passes a logger with DEBUG enabled — common in development or verbose CI environments — passwords from the import CSV are written to the log output.
Proposed fix
Before any logging in _validate_import_line_or_throw, mask or omit the password field. For example, replace it with "***" in any debug-logged representation of the line:
def _safe_log_line(values):
masked = list(values)
if len(masked) > UserItem.CSVImport.ColumnType.PASSWORD:
masked[UserItem.CSVImport.ColumnType.PASSWORD] = "***"
return masked
This is a narrow fix — it does not change validation logic, only what gets emitted to the log.
Problem
UserItem.CSVImport._validate_import_line_or_throw(and by extensionvalidate_file_for_import) accepts a caller-suppliedloggerand logs validation details at DEBUG level. The raw CSV values passed in include the password column (column index 1) from user-import files.If a caller passes a logger with DEBUG enabled — common in development or verbose CI environments — passwords from the import CSV are written to the log output.
Proposed fix
Before any logging in
_validate_import_line_or_throw, mask or omit the password field. For example, replace it with"***"in any debug-logged representation of the line:This is a narrow fix — it does not change validation logic, only what gets emitted to the log.