Overview
src/modules/gdpr/gdpr.service.ts exportUserData() builds the export from the user entity. If the serialization does not explicitly exclude password (bcrypt hash), refreshToken, and passwordHistory, these fields are returned in the GDPR Subject Access Request response and could be used for offline hash-cracking attacks.
Specifications
Features:
- GDPR export must explicitly exclude all credential-related fields.
Tasks:
- Create a
GdprExportDto with @Exclude() on password, refreshToken, passwordHistory, totpSecret, and token columns.
- Map the user entity to this DTO before returning the export.
- Add a unit test asserting these fields are absent from the export response.
Impacted Files:
src/modules/gdpr/gdpr.service.ts
- New
src/modules/gdpr/dto/gdpr-export.dto.ts
Acceptance Criteria
- GDPR export response does not include
password, refreshToken, or passwordHistory.
- All other PII fields (name, email, enrollments) are present.
- Unit test verifies field exclusion.
Overview
src/modules/gdpr/gdpr.service.tsexportUserData()builds the export from the user entity. If the serialization does not explicitly excludepassword(bcrypt hash),refreshToken, andpasswordHistory, these fields are returned in the GDPR Subject Access Request response and could be used for offline hash-cracking attacks.Specifications
Features:
Tasks:
GdprExportDtowith@Exclude()onpassword,refreshToken,passwordHistory,totpSecret, and token columns.Impacted Files:
src/modules/gdpr/gdpr.service.tssrc/modules/gdpr/dto/gdpr-export.dto.tsAcceptance Criteria
password,refreshToken, orpasswordHistory.