Security: Mask credentials in debug logs, replace yamljs, update dependencies#24
Merged
larsdecker merged 8 commits intomasterfrom Dec 27, 2025
Merged
Conversation
Co-authored-by: larsdecker <1968186+larsdecker@users.noreply.github.com>
Co-authored-by: larsdecker <1968186+larsdecker@users.noreply.github.com>
Co-authored-by: larsdecker <1968186+larsdecker@users.noreply.github.com>
Co-authored-by: larsdecker <1968186+larsdecker@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Enhance security measures for library
Security: Mask credentials in debug logs, replace yamljs, update dependencies
Dec 27, 2025
There was a problem hiding this comment.
Pull request overview
This pull request significantly improves the security posture of the FinTS library by preventing credential leaks in debug logs, replacing an unmaintained dependency, and providing comprehensive security documentation.
Key Changes:
- Masks PIN and TAN credentials in HNSHA segment debug output to prevent accidental exposure in logs
- Replaces deprecated
yamljs(last updated 2016) with actively maintainedyamlpackage - Updates development dependencies (TypeScript, ESLint plugins, minimatch) to latest versions
- Adds comprehensive SECURITY.md and security best practices section to README
Reviewed changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/fints/src/segments/hnsha.ts | Overrides debugString getter to mask PIN/TAN credentials with ***MASKED*** while preserving actual values in toString() for transmission |
| packages/fints/src/segments/tests/test-hnsha.ts | Adds comprehensive security tests verifying credentials are masked in debug output but exposed in serialization |
| packages/fints/src/http-connection.ts | Removes credential exposure from verbose logging by only logging URL instead of full request string |
| packages/fints-cli/src/config.ts | Migrates from yamljs to yaml package with equivalent API usage |
| packages/fints-cli/package.json | Updates dependencies: adds yaml 2.8.2, removes yamljs and @types/yamljs, updates TypeScript and minimatch |
| packages/fints/package.json | Updates devDependencies: TypeScript to 5.9.3, minimatch to 10.1.1 |
| package.json | Updates root devDependencies: eslint-config-prettier to 10.1.8, eslint-plugin-prettier to 5.5.4, TypeScript to 5.9.3 |
| yarn.lock | Reflects all dependency updates and removals |
| SECURITY.md | New comprehensive security policy covering credential masking, dependency security, HTTPS enforcement, best practices, and vulnerability disclosure process |
| README.md | Adds security section with credential handling guidelines and secure coding examples |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improves library security by preventing credential leaks, replacing unmaintained dependencies, and documenting security best practices.
Critical: Credential Exposure in Debug Logs
When debug mode was enabled, PINs and TANs were logged in plain text. The HNSHA segment's
debugStringnow masks credentials:Changes:
HNSHA.debugStringto mask PIN/TAN with***MASKED***HttpConnection.send()verbose loggingtoString()still serializes actual credentials for transmissionReplace Deprecated yamljs
Replaced unmaintained
yamljs(last updated 2016) with actively maintainedyamlpackage:Dependency Updates
typescript: ^5.8.0 → ^5.9.3eslint-config-prettier: ^9.1.0 → ^10.1.8eslint-plugin-prettier: ^5.1.3 → ^5.5.4minimatch: ^10.0.1 → ^10.1.1Documentation
Added
SECURITY.mdwith vulnerability disclosure process and security best practices section to README covering credential management, debug mode usage, and secure connection handling.Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.