Skip to content

server FEATURE hash a clear-text NETCONF user password before storing it - #1823

Merged
michalvasko merged 1 commit into
CESNET:develfrom
niklas-moser:hash-user-passwords
Sep 16, 2026
Merged

michalvasko merged 1 commit into
CESNET:develfrom
niklas-moser:hash-user-passwords

Conversation

@niklas-moser

Copy link
Copy Markdown

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

Comment thread src/main.c
Comment thread src/main.c Outdated
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>
@michalvasko
michalvasko merged commit 4774afc into CESNET:devel Sep 16, 2026
7 checks passed
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.

3 participants