ECSS Communications — Command Authentication (space-systems/ecss/e50-command-authentication)
Use when the task is the single obligation of ECSS-E-ST-50C clause 5.4.5 —
that nothing an unauthorized sender issued ever runs on board — and the
question is what the receiving end must check before it acts. The clause
leaves the means open and notes authentication as one of them; take that
route, as this leaf does, and the protected set has to reach every
telecommand whose origin nothing else in the design vouches for. A command
left outside it is one the spacecraft executes on no evidence of where it
came from.
Domain quick reference
- A matching tag is necessary and not sufficient. A tag copied from a
command sent an hour ago matches perfectly, which is why the counter is
part of what is authenticated and part of what is checked.
- The counter check has two sides and only one is obvious. A counter at
or below the last accepted one is a replay; a counter far above it is
an attempt to push the receiver's state somewhere it cannot be brought
back from, and a window is what keeps a lost command from locking the
link out.
- Key validity is not the same question as tag correctness. A retired key
still produces tags that verify against itself, so the validity range
has to be tested before the tag, or a compromised old key stays useful
forever.
- The tag has to cover everything that must not change: the key in use,
the counter, and the command content. A tag over the content alone can
be lifted onto a different counter, and a tag over the counter alone
can be lifted onto a different command.
- Comparison is a side channel unless it is written not to be. An
early-exit comparison reveals how many leading octets were right, which
is enough to recover a tag one octet at a time.
- Authentication that is not required is not a reason to refuse. A
command outside the protected set that arrives with a tag is still a
valid command, and the tag is recorded rather than held against it.
Workflow
- Resolve policy first: is this command one that may only be acted on
when authenticated. That answer decides what an absent tag means, so
draw the protected set it comes from to hold every telecommand whose
sender the design does not already establish by other means. One
left out of that set is acted on because its origin was assumed, and
an assumption is not a check.
- With no tag presented, refuse a protected command and accept an
ordinary one, saying which rule applied.
- Resolve the key named by the command. An unresolvable key is its own
refusal reason, distinct from a tag that did not match.
- Test the key's validity range against the command counter before
touching the tag, so a retired key cannot authenticate anything.
- Grade the counter against the last accepted one and the window:
replay, too far ahead, or a genuine advance.
- Derive the tag over the key identity, the counter and the command
content, compare it with the carried one in constant time, and return
the outcome with the counter state the receiver should keep. A
refused command is then never run on board: the outcome gates
execution rather than annotating it. Across a protected set drawn as
step 1 requires, that is what leaves only commands traced to an
authorized sender able to act on the spacecraft.
Obligations
| Item |
Step |
| ECSS-E-ST-50C Rev.2 5.4.5a |
6 |
Pitfalls
- Checking the tag and nothing else. The tag proves the command was once
authorized; only the counter proves it was authorized now.
- Comparing tags with an ordinary equality test. It stops at the first
differing octet, and the timing difference turns a search over the
whole tag into a search over one octet at a time.
- Leaving the key validity range untested because the tag verified. It
verified against the key presented, which is exactly what a retired or
leaked key does.
- Accepting any counter above the last one. A single command with an
enormous counter advances the receiver's state past every legitimate
command the ground still has queued.
- Authenticating the payload without the counter, or the counter without
the payload. Either leaves a tag that can be lifted onto a command it
was never issued for.
- Refusing a command because it carried a tag it did not need. The
protected set says which commands must be authenticated, not which
commands may be.
Behavior contract (gate 3)
The octet and key validation, tag width limits, key validity range, counter
freshness with its window, tag derivation over key identity, counter and
content, the constant-time comparison and the ordered accept-or-refuse
decision are exercised by the gate 3 contract test:
scripts/test_e50_command_authentication.py against
scripts/e50_command_authentication_logic.py (stdlib unittest, offline). Run:
python3 scripts/test_e50_command_authentication.py
Compliance
- ECSS standards are freely downloadable (ESA); cite the source and
paraphrase per standards-map.yaml.
- compliance: STANDARDS-REF, gated: false.
1---2name: e50-command-authentication3description: "Evaluate whether a telecommand may be acted on under the command authentication obligation of ECSS-E-ST-50C clause 5.4.5: decide from policy whether this command needs authentication at all, check the key is still valid at this command counter, separate a replayed counter and one too far ahead to trust from a genuine advance, then compare the carried tag with the derived one in constant time and report which of those steps refused the command. Use when an uplink must resist replay, spoofing or an expired key. Trigger: ecss, e-st-50c-communications-scope, telecommand-authentication, command-replay-protection, uplink-authentication-tag, command-counter-window, authentication-key-validity, spoofed-telecommand-refusal."4license: Apache-2.05compliance: STANDARDS-REF6standards:7 - id: ecss8 reference-only: true9gated: false10domain: space-systems11pack: space-systems12compatibility: "agentskills.io SKILL.md; any SKILL.md host (Claude Code, Hermes, OpenClaw)"13clauses:14 - standard: ECSS-E-ST-50C Rev.215 clause: 5.4.516 items: [a]17 relation: implements18metadata:19 source: https://skillmd.com/skills/ashfordeou/e50-command-authentication20 domain: space-systems21 subdomain: ecss22 tags: [ecss, e-st-50c-communications-scope, e50-command-authentication, telecommand-authentication, command-replay-protection, uplink-authentication-tag, command-counter-window, authentication-key-validity]23 version: 0.1.024 author: Aero Agent Skills25---2627# ECSS Communications — Command Authentication (space-systems/ecss/e50-command-authentication)2829Use when the task is the single obligation of ECSS-E-ST-50C clause 5.4.5 —30that nothing an unauthorized sender issued ever runs on board — and the31question is what the receiving end must check before it acts. The clause32leaves the means open and notes authentication as one of them; take that33route, as this leaf does, and the protected set has to reach every34telecommand whose origin nothing else in the design vouches for. A command35left outside it is one the spacecraft executes on no evidence of where it36came from.3738## Domain quick reference3940- A matching tag is necessary and not sufficient. A tag copied from a41 command sent an hour ago matches perfectly, which is why the counter is42 part of what is authenticated and part of what is checked.43- The counter check has two sides and only one is obvious. A counter at44 or below the last accepted one is a replay; a counter far above it is45 an attempt to push the receiver's state somewhere it cannot be brought46 back from, and a window is what keeps a lost command from locking the47 link out.48- Key validity is not the same question as tag correctness. A retired key49 still produces tags that verify against itself, so the validity range50 has to be tested before the tag, or a compromised old key stays useful51 forever.52- The tag has to cover everything that must not change: the key in use,53 the counter, and the command content. A tag over the content alone can54 be lifted onto a different counter, and a tag over the counter alone55 can be lifted onto a different command.56- Comparison is a side channel unless it is written not to be. An57 early-exit comparison reveals how many leading octets were right, which58 is enough to recover a tag one octet at a time.59- Authentication that is not required is not a reason to refuse. A60 command outside the protected set that arrives with a tag is still a61 valid command, and the tag is recorded rather than held against it.6263## Workflow64651. Resolve policy first: is this command one that may only be acted on66 when authenticated. That answer decides what an absent tag means, so67 draw the protected set it comes from to hold every telecommand whose68 sender the design does not already establish by other means. One69 left out of that set is acted on because its origin was assumed, and70 an assumption is not a check.712. With no tag presented, refuse a protected command and accept an72 ordinary one, saying which rule applied.733. Resolve the key named by the command. An unresolvable key is its own74 refusal reason, distinct from a tag that did not match.754. Test the key's validity range against the command counter before76 touching the tag, so a retired key cannot authenticate anything.775. Grade the counter against the last accepted one and the window:78 replay, too far ahead, or a genuine advance.796. Derive the tag over the key identity, the counter and the command80 content, compare it with the carried one in constant time, and return81 the outcome with the counter state the receiver should keep. A82 refused command is then never run on board: the outcome gates83 execution rather than annotating it. Across a protected set drawn as84 step 1 requires, that is what leaves only commands traced to an85 authorized sender able to act on the spacecraft.8687## Obligations8889| Item | Step |90|---|---|91| ECSS-E-ST-50C Rev.2 5.4.5a | 6 |9293## Pitfalls9495- Checking the tag and nothing else. The tag proves the command was once96 authorized; only the counter proves it was authorized now.97- Comparing tags with an ordinary equality test. It stops at the first98 differing octet, and the timing difference turns a search over the99 whole tag into a search over one octet at a time.100- Leaving the key validity range untested because the tag verified. It101 verified against the key presented, which is exactly what a retired or102 leaked key does.103- Accepting any counter above the last one. A single command with an104 enormous counter advances the receiver's state past every legitimate105 command the ground still has queued.106- Authenticating the payload without the counter, or the counter without107 the payload. Either leaves a tag that can be lifted onto a command it108 was never issued for.109- Refusing a command because it carried a tag it did not need. The110 protected set says which commands must be authenticated, not which111 commands may be.112113## Behavior contract (gate 3)114115The octet and key validation, tag width limits, key validity range, counter116freshness with its window, tag derivation over key identity, counter and117content, the constant-time comparison and the ordered accept-or-refuse118decision are exercised by the gate 3 contract test:119scripts/test_e50_command_authentication.py against120scripts/e50_command_authentication_logic.py (stdlib unittest, offline). Run:121python3 scripts/test_e50_command_authentication.py122123## Compliance124125- ECSS standards are freely downloadable (ESA); cite the source and126 paraphrase per standards-map.yaml.127- compliance: STANDARDS-REF, gated: false.