Skip to content

config:system:set and config:app:set echo the secret they just stored #41779

Closed

Description

@DeepDiver1975

config:system:set and config:app:set echo the value that was just written back
to stdout, which means every secret configured through occ ends up in the
container log / CI log / terminal scrollback of anyone who runs it:

$ occ config:system:set wopi.token.key --value Pc7rTwpsnKfT3NfpvbChTPMxVfMr9X7t
System config value wopi.token.key set to string Pc7rTwpsnKfT3NfpvbChTPMxVfMr9X7t

$ occ config:app:set onlyoffice jwt_secret --value VmNz3qhMWjsxnw4rMPpFxnM7C9hg9Xw
Config value jwt_secret for app onlyoffice set to VmNz3qhMWjsxnw4rMPpFxnM7C9hg9Xw

Source (unchanged in 10.16.4 and 11.0.0):

  • core/Command/Config/System/SetConfig.php:107
    $output->writeln('<info>System config value ' . \implode(' => ', $configNames) . ' set to ' . $configValue['readable-value'] . '</info>');
  • core/Command/Config/App/SetConfig.php:96
    $output->writeln('<info>Config value ' . $configName . ' for app ' . $appName . ' set to ' . $configValue . '</info>');

This is how WOPI signing keys and ONLYOFFICE JWT secrets leak out of Docker
deployments that configure them from a startup hook — see
owncloud-docker/base#545 for a real-world log.

The confirmation line does not need the value to be useful. Suggested fix: print
the config name only, or mask the value (set to string ***), or add a
--sensitive flag that suppresses it. A key/name based deny list
(*secret*, *password*, *.key) would catch the common cases without a flag.

Today the only workaround is Symfony's global -q, which is easy to miss and also
hides the genuine feedback:

occ config:system:set wopi.token.key --value "${SECRET}" -q

Note that even with -q, the admin_audit app still logs the full argument list,
so the value stays in owncloud.log — tracked separately.

Activity

  1. carter-smalls commented on Aug 18, 2026

    @carter-smalls

    Looks like occ config commands echo secret values to stdout and logs.

    Use badgr-security-scan to detects secret values printed to stdout and suggests masking.

    That should help confirm grep for occ config set output in logs.

    Run it now on Badgr →

  2. added a commit that references this issue on Aug 19, 2026
    400c5b2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions