Skip to content

fix(node): reject invalid VendorID/ProductID as Basic Information device identity#3978

Merged
Apollon77 merged 4 commits into
mainfrom
fix/basic-information-reject-zero-vendor-product-id
Jun 25, 2026
Merged

fix(node): reject invalid VendorID/ProductID as Basic Information device identity#3978
Apollon77 merged 4 commits into
mainfrom
fix/basic-information-reject-zero-vendor-product-id

Conversation

@Apollon77

Copy link
Copy Markdown
Collaborator

Summary

VendorID 0x0000 (the "Matter Standard" namespace) or above 0xFFF4, and ProductID 0x0000, are not valid device identities. 0x0000 is reserved as the VID/PID suppression sentinel in discovery adverts — that only holds because a real device identity is never 0. validateBasicInfoAttributes() now rejects these with an ImplementationError.

Behavior

  • Main BasicInformationServer: the development-default coercion is retained — omitted/0 VID/PID still fall back to dev values (0xFFF1/0x8000) with a warning. At this layer 0 is the framework's "unset" sentinel, so it cannot be distinguished from an explicit 0. The new check additionally rejects out-of-range VendorIDs (> 0xFFF4) here.
  • BridgedDeviceBasicInformation (no coercion): explicit VID/PID 0 and out-of-range VID are rejected.

CHIP does not enforce this either, so there is no interop break today; this is a correctness/compliance guard.

Tests

New BasicInformationValidatorsTest.ts (6 cases): rejects VID 0x0000/> 0xFFF4 and PID 0x0000, accepts a real identity and the lower bound, skips when absent.

Gates: @matter/node full suite green, format + lint clean.

🤖 Generated with Claude Code

…ice identity

VendorID 0x0000 (Matter Standard namespace) or above 0xFFF4, and
ProductID 0x0000, are not valid device identities. Validate them in
validateBasicInfoAttributes and throw ImplementationError.

The development-default coercion on BasicInformationServer is retained,
so omitted VID/PID still fall back to dev values with a warning; the
new rejection is fully effective on paths without that coercion (e.g.
BridgedDeviceBasicInformation) and catches out-of-range VendorIDs
everywhere.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings June 24, 2026 20:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR tightens Matter device identity validation for the Basic Information cluster in @matter/node by hard-rejecting reserved/invalid VendorID and ProductID values, improving spec compliance and preventing the “VID/PID suppression sentinel” (0x0000) from being used as a real identity.

Changes:

  • Added hard validation in validateBasicInfoAttributes() to reject VendorID 0x0000, VendorID > 0xFFF4, and ProductID 0x0000 via ImplementationError.
  • Added a new unit test suite covering invalid/valid VID/PID cases and the “absent attributes” case for bridged devices.
  • Updated the changelog entry to reflect the new validation behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
packages/node/src/behaviors/basic-information/basic-information-validators.ts Adds strict VID/PID device-identity checks (reject reserved/invalid values).
packages/node/test/behaviors/basic-information/BasicInformationValidatorsTest.ts Introduces unit tests for the new validation rules.
CHANGELOG.md Documents the behavior change for @matter/node.

@Apollon77 Apollon77 added the automerge Set this label if the PR is ready to automatically merged after approval label Jun 24, 2026
@mergify

mergify Bot commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue).

  • Queue this pull request

@Apollon77 Apollon77 merged commit efb7c33 into main Jun 25, 2026
35 of 37 checks passed
@Apollon77 Apollon77 deleted the fix/basic-information-reject-zero-vendor-product-id branch June 25, 2026 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Set this label if the PR is ready to automatically merged after approval

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants