Repository navigation
fix(social): label face-room human lines from the server-stamped sender, not the client's who - #151
Conversation
Bot Social already puts an authenticated `from` snapshot on every face-room message. The FLYBOT-FACE-HUMAN `who` is client JSON inside untrusted text, so a peer could impersonate another member. Display the `from` label (or that handle's home) and ignore the claimed name. No Bot Social server change. Do not deploy. Co-authored-by: Danyang Chen <birfychen@gmail.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 910d8e6b3c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| const label = cleanFaceName(from.label, '') | ||
| if (label) return label |
There was a problem hiding this comment.
Preserve the home fallback through event normalization
When a legacy room.message has an authenticated from.handle but omits profile fields, renderFaceEvent() first passes from through viewFaceMember(), which always synthesizes a label (for @writer.alice.home, it produces Writer). This early return therefore prevents the handle branch from selecting Alice, so these messages are mislabeled despite the intended home-label fallback; the new test misses this by calling trustedFaceWho() directly on the raw object. Preserve whether the label was server-supplied or derive the home segment before normalization.
Useful? React with 👍 / 👎.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
The face-to-face human message line carried a
whofilled in by the sending client, so a peer could pretend to be another room member (Codex P1s on #118).Bot Social already stamps the authenticated sender (
handle,display_name,owner_name,label) on everyroom.message, so this is client-only: the line is labelled from that stampedfromand the envelopewhois ignored. Iffromis missing, it falls back to the handle's home name, then "Someone", never a claimed other member. Spoof tests cover a message claiming one member in JSON whilefromnames another.No server change and no deploy needed.