Skip to content

Commit 4afd7cb

Browse files
Beennnnclaude
andcommitted
fix(codeql): drop mid/batid from buffer-cap debug log (PII)
CodeQL flagged the log message in OnMapTrace as 'Clear-text logging of sensitive information' because the formatted tuple included mid/batid. Same class of issue as the earlier d88f690 fix on this branch — only the cap value is needed for diagnosis, the device identifiers are not. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 043590b commit 4afd7cb

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

deebot_client/messages/json/map/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -330,10 +330,11 @@ def _handle_body_data_dict( # noqa: PLR0911 - error-handling fan-out reads clea
330330
existing = cls._CHUNK_BUFFER.get(key, {})
331331
per_key_total = sum(len(b) for b in existing.values()) + len(chunk_bytes)
332332
if per_key_total > cls._MAX_BYTES_PER_KEY:
333+
# Don't log mid/batid — those identify a specific account/device
334+
# and CodeQL flags them as PII.
333335
_LOGGER.debug(
334-
"onMapTrace: per-key buffer cap (%d B) exceeded for %s; dropping",
336+
"onMapTrace: per-key buffer cap (%d B) exceeded; dropping",
335337
cls._MAX_BYTES_PER_KEY,
336-
key,
337338
)
338339
cls._CHUNK_BUFFER.pop(key, None)
339340
return HandlingResult.analyse()

0 commit comments

Comments
 (0)