Skip to content

fix(webhandler): remove printRequest() from credential-handling set* handlers #236

@Phantomias2006

Description

@Phantomias2006

Problem

Eight set* handlers call printRequest(datas) which expands to DPRINTF("[REQUEST]\t%s\r\n", ...). By default DPRINTF is a no-op, but when DEBUG = SERIAL_DEBUG is enabled for troubleshooting, four of these handlers leak credentials in plaintext to the serial console:

  • setNetwork / addNetwork: WiFi password
  • setIoT: MQTT user + password, Cloud token, custom URL
  • setPush: Telegram bot token, Pushover bot token, Pushover user key, FCM push tokens

Any developer enabling debug logging for diagnostics inadvertently exposes all stored credentials on the serial port.

Root Cause

printRequest() dumps the raw POST body (unparsed JSON) to the serial console via DPRINTF. The four credential handlers were treated identically to non-sensitive handlers like setSystem or setPitmaster.

Fix

Removed printRequest(datas) from setNetwork, addNetwork, setIoT, and setPush. The call remains in non-sensitive handlers (setSystem, setChannels, setPitmaster, setPID, setDCTest, setBluetooth).

Review-Finding: CR-001b-009
Severity: MEDIUM (escalates to HIGH when DEBUG enabled)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions