Skip to content

fix insecure default inherited from zcash + implement secure deletion of debug.log#99

Closed
hairetikos wants to merge 8 commits intoZclassicCommunity:masterfrom
hairetikos:zclassic-community-master
Closed

fix insecure default inherited from zcash + implement secure deletion of debug.log#99
hairetikos wants to merge 8 commits intoZclassicCommunity:masterfrom
hairetikos:zclassic-community-master

Conversation

@hairetikos
Copy link

fixes #97

Logging Configuration

  • disabled debug.log by default. This insecure default was inherited from zcash. the debug log may contain sensitive transaction metadata. it should only be used for debugging, not for production, therefore debug logs now are not created unless explicitly enabled.
  • Added the -debuglogfile config option since it is now disabled by default

Privacy and Secure File Handling

  • Added two new RPC commands: shredlogs and shredonion, which securely destroy the debug.log, db.log, and Tor onion service private key files using a multi-pass overwrite and deletion process. This helps protect user privacy by ensuring sensitive metadata and keys are unrecoverable. upon restarting the node, a new Onion V3 private key and address will be auto-generated

  • the SecureShredFile function in src/rpc/misc.cpp performs a DoD 5220.22-M-style secure file wiping, including overwriting with multiple patterns, renaming, and then deleting the file.

These changes collectively enhance the privacy and security of the application, giving users more control over sensitive files and debug information.

fix full complete sync from genesis (without fast sync)

Allow larger blocks for historical chain variations
since updating the curl version to a more secure version, it will try to build with libpsl by default, which will fail on platforms without libspl

we don't need spl, so add --without-libpsl to fix those builds
img2txt -W 88 -H 20 -f utf8 -d none contrib/newlogo.png > newlogo.ansi
this insecure default was inherited from zcash

debug.log contains a lot of sensitive transaction metadata, it should only be enabled for debugging purposes (hence, it is called debug.log)

disable it by default
These functions securely shred files using a 3-pass overwrite pattern, ensuring sensitive data is irrecoverable.

This is important because the `debug.log` file may contain sensitive transaction metadata.  `debug.log` should only be used for debugging purposes.

a function to also securely shred the onion V3 private key.  upon restarting the node a new V3 key and address will be auto-generated
@hairetikos
Copy link
Author

i have tested the shred function by checking hexdump at various shredding pass stages, and confirms it works well

but it may be best instead to implement it using exising OS-specific shredding tools such as shred on Linux, SDelete on windows (sysinternals), and gshred or shred on Mac OS ... as otherwise we are trying to reinvent an existing well-made wheel

will close this, and re-open the PR using existing shredding tools, the best option

@hairetikos hairetikos closed this Nov 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

insecure default configs inherited from zcash

1 participant