Skip to content

Commit

Permalink
Fix for code scanning alert no. 27: Clear-text logging of sensitive i…
Browse files Browse the repository at this point in the history
…nformation (#8301)

* Potential fix for code scanning alert no. 27: Clear-text logging of sensitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>

* Changeset

---------

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
  • Loading branch information
ardatan and github-advanced-security[bot] authored Jan 21, 2025
1 parent d26ba2e commit 78c202e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions .changeset/tiny-fans-drive.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
'@graphql-mesh/string-interpolation': patch
---

Avoid logging sensitive data directly. Instead, log a generic error message without including the potentially sensitive str variable. This way, it still notifies of errors without risking the exposure of sensitive information.

- Replace the logging statement on line 176 in `packages/string-interpolation/src/interpolator.js` to avoid logging the `str` variable.
- Ensure that the new logging statement provides enough information to debug the issue without exposing sensitive data.
2 changes: 1 addition & 1 deletion packages/string-interpolation/src/interpolator.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ export class Interpolator {
str,
);
} catch (e) {
console.error(`An error occurred while applying modifiers to ${str}`, modifiers, e);
console.error(`An error occurred while applying modifiers`, e);
return str;
}
}
Expand Down

0 comments on commit 78c202e

Please sign in to comment.