Summary
The EnergizeLab Eilik NestJS authentication service issues valid device tokens for arbitrary robot serial numbers without verifying the requester's identity. An unauthenticated remote attacker may obtain a token for another device and use it to impersonate that device against connected cloud services.
Affected context
The vulnerability occurs in deployments where the Eilik NestJS authentication service accepts a robot serial number as sufficient authority for issuing a device token. It is especially risky when the service is reachable remotely, does not require prior authentication, and cloud APIs trust issued tokens as proof of device identity.
Exploit preconditions
- Attack surface: Remotely reachable device-token issuance endpoint
- Required access: No authentication or valid device credentials
- Trigger point: A token request containing a robot serial number
- Why exploitation is possible: The service does not establish ownership of the requested serial number before issuing a token
Why this happens
The underlying flaw is an authentication decision based on an attacker-controlled device identifier. A serial number functions as an identifier, but the service treats it as proof of identity and issues a bearer token without an independent authentication or ownership check. This maps primarily to CWE-287: Improper Authentication and is also consistent with CWE-306: Missing Authentication for Critical Function.
Potential impact
- An attacker could impersonate arbitrary registered robots
- Cloud services may accept unauthorized commands or requests as a device
- Device-associated data could be accessed, modified, or exposed
- Device activity and audit records could be attributed to the impersonated robot
- Compromised tokens could support broader abuse of trusted cloud-service workflows
General mitigation guidance
Mitigation generally focuses on ensuring that device identifiers are not treated as authentication credentials.
Common defensive patterns include:
- Require strong device authentication or mutual proof of possession before issuing tokens
- Bind tokens to verified device credentials, cryptographic keys, or enrollment records
- Validate device ownership and enrollment state on every token-issuance path
- Apply least privilege and narrow scopes to device tokens
- Use short token lifetimes with rotation and revocation capabilities
- Rate-limit and monitor authentication-related requests
- Avoid exposing token-issuance endpoints without an authenticated trust bootstrap
How teams detect issues like this
Organizations can look for:
- Static analysis and code review findings where user-supplied serial numbers directly authorize token creation
- Authentication handlers that issue bearer tokens without credential, signature, or ownership verification
- API policies requiring authentication on device enrollment and token-issuance operations
- Logs showing repeated token requests for multiple serial numbers from unauthenticated clients
- Tests that attempt token issuance for unowned, unknown, or already-enrolled devices
Automated API security testing and policy checks can help identify endpoints that expose privileged token-generation behavior without authentication.

