server FEATURE hash a clear-text NETCONF user password before storing it - #1823
Merged
Merged
Conversation
Roytak
requested changes
Sep 10, 2026
niklas-moser
force-pushed
the
hash-user-passwords
branch
from
September 15, 2026 10:04
2340c0d to
ab7830b
Compare
iana-crypt-hash, and RFC 9645 with it, define "$0$<cleartext>" as a value the server is expected to replace with a hash before storing. It is stored verbatim, leaving the clear text in the datastore and in every export of it. The ietf-netconf-server subscription is DONE_ONLY, which sysrepo runs only after the commit, so add subscriptions with SR_SUBSCR_UPDATE that rewrite every created or modified "$0$" hashed-password under listen/ and call-home/ into a "$6$" digest. Running, startup and candidate are all covered, any of them can be written directly and startup is copied into running on the next start, when no subscription exists yet. Values that arrive already hashed are left alone, as are older datastores still holding a "$0$" one. Needs nc_server_config_hash_password() from libnetconf2. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
niklas-moser
force-pushed
the
hash-user-passwords
branch
from
September 15, 2026 12:48
ab7830b to
112f1d1
Compare
Roytak
approved these changes
Sep 15, 2026
michalvasko
approved these changes
Sep 16, 2026
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.
iana-crypt-hash, and RFC 9645 with it, define "$0$" as a value the server is expected to replace with a hash before storing. Netopeer2 stores it verbatim, leaving the clear text in the running datastore and in every export
of it. O-RAN WG11 R004, and 3GPP TS 33.117 clause 4.2.3.4.3.1 behind it, rule that out for a deployment that has to pass security conformance.
libnetconf2 can't fix this on its side: it gets the ietf-netconf-server data through a DONE_ONLY subscription, which sysrepo runs only after the commit. So this adds a second subscription with SR_SUBSCR_UPDATE — the one phase in
which a subscriber may still edit the data — and rewrites every created or modified "$0$" hashed-password under listen/ and call-home/ into a "$6$" digest, via nc_server_config_hash_password() from CESNET/libnetconf2#.
Already hashed values are untouched, and so are older datastores still holding a "$0$" one, which the SSH auth path keeps accepting — no datastore migration, only a change to what gets stored from now on.
Depends on CESNET/libnetconf2#639