Skip to content

Bug: /relay/ping new-agent path uses undefined helper and weak verification fallback #39

@autonomy414941

Description

@autonomy414941

Summary

/relay/ping new-agent registration has two security/availability defects in atlas/beacon_chat.py:

  1. It calls agent_id_from_pubkey(...) (undefined), causing a runtime NameError on signed registration attempts.
  2. If Ed25519 verification support is unavailable (PyNaCl missing), signed registration can be accepted without cryptographic verification.

Reproduction

  1. Start Atlas backend from a clean environment where PyNaCl is not installed.
  2. Send a POST to /relay/ping for a new agent with JSON containing agent_id, pubkey_hex, and signature.
  3. Observe behavior in the new-agent path.

Expected

  • Server derives agent_id with the correct helper and does not crash.
  • Server rejects new registrations when signature verification cannot be performed.

Actual

  • NameError from undefined agent_id_from_pubkey in the registration path.
  • Verification-unavailable path may register agents without proven key ownership.

Proposed fix

  • Use agent_id_from_pubkey_hex(...) in /relay/ping.
  • Treat unavailable signature verification as an error for new registrations.
  • Add regression tests for unsigned new-agent rejection and relay-token enforcement for existing agents.

Fix PR: #38

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions