Skip to content

security(slm): the settings API logs setting values, including credentials #20485

Closed

Description

@mrveiss

Problem

autobot-slm-backend/api/settings.py logs Setting updated: %s = %s with the key and value. The generic settings table also holds credential-adjacent settings such as LLM keys, so a change writes their values to the log. Read from the code; no log file was inspected.

Acceptance criteria

  • Setting changes log the key only, never the value, with a test using a secret-looking value.
  • Any other log line in that module that carries a setting value is handled the same way.

Activity

  1. added
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Nov 1, 2026
  2. github-actions commented on Nov 1, 2026

    @github-actions
    Contributor

    needs-structure cleared: goal milestone, matching phase label and native parent (or sub-issues) are all present (#19522).

  3. removed
    needs-structureMissing goal milestone, matching phase label or native parent (#19522)
    on Nov 1, 2026
  4. mrveiss commented on Nov 2, 2026

    @mrveiss
    OwnerAuthor

    Landed in the merge train (PR #20594, 655489c4e6) via #20549.

    AC Evidence
    Setting changes log the key only, never the value, with a test using a secret-looking value autobot-slm-backend/api/settings.py now logs "Setting updated: %s", key, "Setting created: %s", key, "Setting deleted: %s", key. autobot-slm-backend/tests/api/test_settings_log_keys_only_20485.py: test_update_logs_key_not_value, test_create_logs_key_not_value.
    Any other log line in that module that carries a setting value is handled the same way The remaining logger.info calls in settings.py log timezone, NTP servers, node count and a success flag, none a setting value. The same defect in autobot-slm-backend/api/config.py is fixed ("Global config '%s' set", "Node %s config '%s' set"; tests/api/test_config_log_keys_only_20485.py). repo_tests/slm_api_logs_no_request_value_20485_test.py walks every logger call under autobot-slm-backend/api/ and fails on a request body's .value, with a control that the detector fires.

    2 of 2 met. Closing.

  5. mrveiss commented on Nov 2, 2026

    @mrveiss
    OwnerAuthor

    PR #20549 landed in the merge train (PR #20594). This stays open, because the second criterion doesn't hold yet.

    AC Evidence on main Verdict
    Setting changes log the key only, with a test using a secret-looking value autobot-slm-backend/api/settings.py: "Setting updated: %s" and "Setting created: %s" pass key only. api/config.py: "Global config '%s' set" likewise. Tests: tests/api/test_settings_log_keys_only_20485.py, tests/api/test_config_log_keys_only_20485.py. Met
    Any other log line in that module carrying a setting value is handled the same way api/settings.py still has logger.info("Time config updated: tz=%s ntp=%s", config.timezone, config.ntp_servers), and "Time sync complete: tz=%s" logs the timezone. Not met

    repo_tests/slm_api_logs_no_request_value_20485_test.py doesn't see these lines, because it only flags <request-body>.value.

    Next: log keys only on those two lines and widen the guard. api/settings.py is held by #20536, so this follows its landing.

  6. mrveiss commented on Nov 2, 2026

    @mrveiss
    OwnerAuthor

    PR #20645 landed in merge train PR #20692 (58cbf98c43). The second criterion now holds, so the closed state stands.

    AC Evidence on main
    Any other log line in that module carrying a setting value is handled the same way autobot-slm-backend/api/settings.py:105 logs "Time config updated" with no values, and :151 logs "Time sync complete: nodes=%d success=%s" with no timezone. repo_tests/slm_api_logs_no_request_value_20485_test.py now flags config.timezone under _VALUE_BODIES, with a control.

    2 of 2 met.

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

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions