Skip to content

fix(recorder): mask the admin password in #login chat commands - #137

Merged
YetheSamartaka merged 3 commits into
OCAP2:mainfrom
YetheSamartaka:fix/mask-login-password
Dec 2, 2026
Merged

YetheSamartaka merged 3 commits into
OCAP2:mainfrom
YetheSamartaka:fix/mask-login-password

Conversation

@YetheSamartaka

Copy link
Copy Markdown
Contributor
  • A #login chat command carries the server admin password. Until now it went in full to the extension, and from there into the recording, the Postgres database, the resend spool and the debug log.
  • The new OCAP_recorder_fnc_redactLoginCommand keeps the command and replaces everything after it with a fixed ********, which doesn't reveal the password's length. Matching ignores case and surrounding whitespace, the same as the web server.
  • Ordinary chat, #logout, and #login in the middle of a sentence are recorded as typed.
  • Tests: adds tests/chat_redaction_regressions.sqf, which needs no players. hemtt check passes. The new test has not been run yet: it needs an Arma test build.

A #login chat command carries the server admin password, which reached
the extension and from there the recording, its database and spool.
The chat handler now keeps the command and replaces everything after it
with a fixed mask ("#login ********") that does not reveal the length.
Matching ignores case and surrounding whitespace, like the web server.

Adds tests/chat_redaction_regressions.sqf, which needs no players.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@YetheSamartaka
YetheSamartaka requested a review from fank December 1, 2026 22:23
@fank

fank commented Dec 1, 2026 •

Copy link
Copy Markdown
Member

Ratatoskr reviewed this pull request.

Changes requested on 8c13f458. See the review.

Finished 2026-12-01 22:29 UTC.

@fank fank left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES — 1 blocking credential-redaction gap.

Review details

Leading Unicode whitespace can leave the password in the extension payload. addons/recorder/fnc_redactLoginCommand.sqf:35–37 uses SQF trim, documented to remove spaces, tabs, and line returns. The companion web implementation uses Go's Unicode-aware strings.TrimSpace. Under the documented SQF behavior, a chat message with a leading non-breaking space (U+00A0) followed by #login synthetic-password fails the prefix check and returns the original text. That sends the password in :EVENT:CHAT: and exposes it in the extension-call debug log before web ingestion can mask it. This does not depend on Arma accepting the message as a successful login. Match the web server's whitespace handling and add an extension-boundary regression with a leading non-breaking space.

The existing payload assertions would catch removal of the redaction call for ASCII input, but do not cover this case. I checked the payload layout against extension c2d8c0c and the fallback against web#626 at 4edca58.

Verification: git diff --check passed. hemtt check and hemtt build passed in a temporary copy of 8c13f45 with HEMTT 1.23.1; the local build warned that Arma 3 Tools were absent. Both steps also passed in GitHub Actions. The SQF regression and live chat path were not run because no Arma 3 runtime was available; the Unicode finding is based on the documented command behavior and source trace.

Earlier discussions: GitHub GraphQL returned no review threads; none to resolve, keep open, or skip.

SQF trim removes only spaces, tabs and line breaks, so a #login behind a
non-breaking space kept its password in the :EVENT:CHAT: payload and the
extension's debug log. The command is now found after any Unicode
White_Space character or U+FEFF, the set the web server trims, matched on
code points from toArray. The regression suite covers the extension
boundary with a leading non-breaking space and other Unicode whitespace.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@YetheSamartaka
YetheSamartaka requested a review from fank December 2, 2026 07:50
@fank

fank commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Ratatoskr reviewed this pull request.

Changes requested on 5cd11fb2. See the review.

Finished 2026-12-02 08:06 UTC.

@fank fank left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REQUEST_CHANGES — 1 blocking compatibility defect in password redaction.

Review details

The login redactor uses an array slice that requires Arma 3 2.14. fnc_redactLoginCommand.sqf:52 calls _chars select [_start + 6] for every matched #login. Bohemia’s 2.14 changelog says the count only became optional in 2.14, but the recorder manifest still declares 2.10. On 2.10 and 2.12, the new helper relies on unsupported behavior before :EVENT:CHAT: is sent, so the masked event is not guaranteed. Pass an explicit count (count _chars - (_start + 6)) or scan the suffix without slicing. The compatibility mismatch is documented; I did not observe the exact older-engine failure mode in game.

Previous finding and coverage: The earlier review’s Unicode prefix issue is addressed at the matching step: the new scan skips NBSP and the same whitespace set as web#626 at 3e6f82b. The extension-boundary test now asserts the masked NBSP payload and would fail if the handler stopped calling the redactor. The extension at c2d8c0c still reads the message from slot 5.

Verification: git diff --check HEAD~2 HEAD passed. hemtt check and hemtt build passed in a temporary copy of 5cd11fb with HEMTT 1.23.1; the local build warned that Arma 3 Tools were absent. Both steps also passed in GitHub Actions. No Arma 3 runtime was available, so neither the SQF regression nor the live chat path was run.

Review threads: GitHub GraphQL returned no review threads; none were resolved, left open, or skipped.

The suffix slice omitted its count, which became optional only in Arma
2.14, while the recorder declares 2.10. Pass the count explicitly and
cover a command at the very end of the message.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@YetheSamartaka
YetheSamartaka requested a review from fank December 2, 2026 17:35
@fank

fank commented Dec 2, 2026 •

Copy link
Copy Markdown
Member

Ratatoskr reviewed this pull request.

Approved on 7f5c0002. See the review.

Finished 2026-12-02 20:04 UTC.

@fank fank left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

APPROVE — 0 blocking findings; both prior findings are addressed.

Review details

Verification: git diff --check passed. hemtt check and hemtt build passed in a temporary copy of 7f5c000 using HEMTT 1.23.1 (local build warned that Arma 3 Tools were absent). Both steps also passed in GitHub Actions. No Arma 3 runtime was available, so neither the SQF regression nor the live chat path was run.

Review threads: GitHub GraphQL returned no threads; none were resolved, left open, or skipped. The earlier findings were in the submitted review bodies linked above.

@YetheSamartaka
YetheSamartaka merged commit 96fdcd8 into OCAP2:main Dec 2, 2026
1 check 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.

2 participants