Skip to content

v26.4.17: REALITY privateKey with base64url chars causes "pattern string does not conform to Letter-Digit-Hyphen (LDH) subset" #5986

@Antoxa113

Description

@Antoxa113

Integrity requirements

  • I have read all the comments in the issue template and ensured that this issue meet the requirements.
  • I confirm that I have read the documentation, understand the meaning of all the configuration items I wrote, and did not pile up seemingly useful options or default values.
  • I provided the complete config and logs, rather than just providing the truncated parts based on my own judgment.
  • I searched issues and did not find any similar issues.
  • The problem can be successfully reproduced in the latest Release

Description

Bug Report

Version: v26.4.17
OS: Ubuntu 24, Linux amd64

Problem

After upgrading from v26.3.27 to v26.4.17, xray-core fails to start with REALITY inbound.

Error:
Failed to start: main: failed to create server > pattern string does not conform to Letter-Digit-Hyphen (LDH) subset

Cause

The REALITY privateKey is in standard base64url format which may contain underscore _ and dash - characters. These are valid base64url characters but do not conform to LDH subset, which apparently is now being validated in v26.4.17.

Example privateKey that triggers the bug:

aB3_xYz9KqmN2pLvWsRtUcHdEfGhJkMnOpQrStUvWxY

Steps to reproduce

  1. Generate a REALITY keypair with xray x25519 (until you get a key containing _)
  2. Use the privateKey in server config
  3. Start xray v26.4.17 → fails with LDH error
  4. Downgrade to v26.3.27 → works fine

Expected behavior

privateKey in base64url format should be accepted as before.

Workaround

Downgrade to v26.3.27.

Reproduction Method

Steps to reproduce

  1. Generate a REALITY keypair with xray x25519 (until you get a key containing _)
  2. Use the privateKey in server config
  3. Start xray v26.4.17 → fails with LDH error
  4. Downgrade to v26.3.27 → works fine

Client config

Not applicable

Server config

Not applicable

Client log

Not applicable

Server log

Not applicable

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions