Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Bug Report: LogDecorator mistakenly redacted function parameters when LoggingLevel = debug #5655

Closed
2 tasks done
tam-endue opened this issue May 31, 2024 · 3 comments
Closed
2 tasks done
Labels

Comments

@tam-endue
Copy link

📜 Description

When LOGGING_LEVEL set to debug, the @LogDecorator set methods parameters that are sensitive fields like email to REDACTED, which lead to issue with the api /widgets/session/initialize, which ever body param sent, it will always return "Email must be an email" error message.

👟 Reproduction steps

  1. Set LOGGING_LEVEL to debug
  2. Initialize session using /widgets/session/initialize

👍 Expected behavior

Initialize session successfully and return token

👎 Actual Behavior with Screenshots

InitializeSessionCommand {
  subscriberId: 'endue199381',
  applicationIdentifier: 'xxxxx',
  email: '[REDACTED]',
  firstName: '[REDACTED]',
  lastName: '[REDACTED]',
  phone: '[REDACTED]',
  hmacHash: 'xyz'
}

Novu version

0.24.2

npm version

No response

node version

No response

📃 Provide any additional context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • I checked and didn't find a similar issue

🏢 Have you read the Contributing Guidelines?

Are you willing to submit PR?

None

Copy link

linear bot commented May 31, 2024

NV-3838 🐛 Bug Report:

@tam-endue
Copy link
Author

@scopsy look like you knows the LogDecorator class well, maybe you want to take a look

@tam-endue tam-endue changed the title 🐛 Bug Report: 🐛 Bug Report: LogDecorator mistakenly redacted function parameters when LoggingLevel = debug Jun 3, 2024
@rifont
Copy link
Collaborator

rifont commented Jun 3, 2024

Thanks for reporting this @tam-endue .

We've encountered this issue too (Linear ref: NV-3274) . We traced the root cause back to fast-redact as a 4th layer transitive dependency of nestjs-pino, which mutates the objects passed for redaction in place.

Unfortunately the fix hasn't yet arrived in our direct dependency. Our only option as of now is to specify an overrides in the monorepo root package.json to manually specify the fix version.

Would you be open to submitting a PR for this fix?

@linear linear bot closed this as not planned Won't fix, can't repro, duplicate, stale Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants