rfc-4822

RIPv2 Cryptographic Authentication

R. Atkinson, M. Fanto
date2007-02 streamIETF wgnon working group statusPROPOSED STANDARD pages22 canonicalhttps://www.rfc-editor.org/rfc/rfc4822 doi10.17487/RFC4822
This note describes a revision to the RIPv2 Cryptographic Authentication mechanism originally specified in RFC 2082. This document obsoletes RFC 2082 and updates RFC 2453. This document adds details of how the SHA family of hash algorithms can be used with RIPv2 Cryptographic Authentication, whereas the original document only specified the use of Keyed-MD5. Also, this document clarifies a potential issue with an active attack on this mechanism and adds significant text to the Security Considerations section. [STANDARDS-TRACK]

obsoletes

updates

Extracted elements (28)

design-rationale §1

Backwards compatibility with RFC 2082 Keyed-MD5 implementations was required, precluding significant protocol changes. The algorithm-independent design of the original specification allowed SHA algorithms to be added without breaking existing deployments.

routing, crypto

design-rationale §3.1

Integrated key management was deliberately omitted from this specification to avoid having to change all RIPv2 implementations if a flaw in a key management protocol is discovered later; the Key-ID field serves as a hook for a future standardized key management protocol.

routing, security

design-rationale §1

The HMAC construction was chosen over the Keyed-MD5 hashing construction because HMAC is widely believed to be stronger. The IESG approved this document despite not meeting BCP 107 automated key management guidelines to encourage rapid migration away from Keyed-MD5.

routing, crypto, security

interoperability-note §3.2

At least one widely-used implementation of the prior specification (RFC 2082) violates the requirement to use Key-ID and interface to select a Security Association (instead trying all keys), creating a denial-of-service vulnerability; conforming implementations MUST NOT do this.

routing, security

normative-requirement §2.3.2 MUST

A router that has forgotten its current sequence number but remembers its Security Association MUST send its first packet with a sequence number of zero; implementers SHOULD provide non-volatile storage for all Security Association components and last received sequence numbers.

routing, security

normative-requirement §2.2 MUST

An implementation MUST be able to support at least 2 concurrent RIPv2 Security Associations on each RIP interface to support key rollover, which is mandatory.

routing, security

normative-requirement §5.1 MUST

Any actual occurrence of a RIPv2 Security Association expiration MUST cause a security event to be logged including the expired key, affected RIP instance(s), affected interfaces, Key-ID, and current date/time.

routing, security

normative-requirement §2.5 MUST NOT

Any known weak key values for NIST Secure Hash Standard algorithms MUST NOT be used with those algorithms.

routing, crypto, security

normative-requirement §5.1 SHOULD

During key rollover, routers SHOULD implement an algorithm to detect which Security Associations neighbors are using and transmit using both old and new Security Associations until all neighbors have migrated or the old association expires.

routing, security

normative-requirement §2.3.2 MUST

If authentication data verification fails, the message MUST be discarded without being processed, and a security event SHOULD be logged including day/time, source IP, Key-ID, interface, and the authentication failure fact.

routing, security

normative-requirement §2.3.2 MUST

If the neighbor has been heard from recently and the received sequence number is less than the last received sequence number, the message MUST be discarded unprocessed and the out-of-order sequence number SHOULD be logged as a security event.

routing, security

normative-requirement §3.1 MUST

Implementations MUST support the storage of more than one key simultaneously, MUST associate a Security Association lifetime and key identifier with each key, and MUST support manual key distribution.

routing, security

normative-requirement §4 MUST

Keyed-MD5 and HMAC-SHA-1 MUST be implemented by all conforming implementations; HMAC-SHA-256, HMAC-SHA-384, and HMAC-SHA-512 SHOULD be implemented.

routing, crypto, security

normative-requirement §2.2 SHOULD

Receivers SHOULD keep track of the most recent sequence number received from a given sender to detect replay attacks.

routing, security

normative-requirement §2.2 MUST NOT

The Authentication Key MUST NOT ever be sent over the network in cleartext via any protocol.

routing, crypto, security

normative-requirement §3.2 MUST NOT

The receiver MUST NOT try all configured RIPv2 Security Associations (keys) on the receiving interface, as this creates an easily exploited denial-of-service attack; the Key Identifier and receiving interface MUST be used to select the specific Security Association.

routing, security

normative-requirement §2.1 MUST

The Sequence Number MUST be non-decreasing for all messages sent from a given source router with a given Key ID value.

routing, security

normative-requirement §5.1 MUST

When the last RIPv2 Security Association of an interface expires, the router MUST send a notification to the network manager and SHOULD treat that last Security Association as having an infinite lifetime until replaced or deleted.

routing, security

protocol-element §2.5

The HMAC key preparation step: if the Authentication Key equals L octets it is used as-is as Ko; if longer, Ko = H(Authentication Key); if shorter, Ko is zero-padded to L octets. Ko is always L octets long.

routing, crypto

protocol-element §2.2

The RIPv2 Security Association is the central configuration construct containing: KEY-IDENTIFIER (8-bit), AUTHENTICATION ALGORITHM (KEYED-MD5, HMAC-SHA-1, HMAC-SHA-256, HMAC-SHA-384, or HMAC-SHA-512), AUTHENTICATION KEY, SEQUENCE NUMBER (32-bit), START TIME, and STOP TIME. A Security Association is always associated with an interface, not a router.

routing, crypto, security

security-consideration §5.6 SHOULD

If a user interface only permits ASCII text entry for cryptographic keys, significant bits become predictable, reducing key strength. Implementations SHOULD support entry of cryptographic keys in hexadecimal format.

routing, crypto, security

security-consideration §5.6

Receipt of a RIPv2 packet with an unknown, expired, or invalid KEY-ID SHOULD cause a security event to be logged including the invalid KEY-ID, source IP, interface, and date/time, as it may indicate an active attack.

routing, security

security-consideration §5

The mechanism protects against passive attacks but provides incomplete protection against active attacks. The main active-attack vulnerability is the reboot scenario where a router loses its sequence number and must restart from zero, creating a brief replay window.

routing, security

security-consideration §5.5 SHOULD

The mechanism provides no confidentiality for RIPv2 messages, which remain in the clear. Bulk link encryption SHOULD be used when protection against traffic analysis is required.

routing, security, privacy

security-consideration §5.2 SHOULD NOT

Use of SNMP (including SNMPv3) or non-key-management protocols (e.g., RADIUS, Diameter) to modify or configure RIPv2 Security Associations is NOT RECOMMENDED, as a compromise of those protocols would cascade into compromise of all RIPv2 routing.

routing, security, snmp

wire-format §2.5

For HMAC-SHA authentication, the Authentication Data field is first filled with Apad (0x878FE1F3 repeated L/4 times), then First-Hash = H(Ko XOR Ipad || RIPv2 Packet) and Second-Hash = H(Ko XOR Opad || First-Hash). The output is NOT truncated; Authentication Data Length equals the full hash output size (e.g., 20 bytes for HMAC-SHA-1).

routing, crypto

wire-format §2.4

For Keyed-MD5, the 16-octet Authentication Key is appended to the RIPv2 packet in memory, followed by MD5 trailing pad octets and a 64-bit message length, then MD5 is computed per RFC 1321. The Authentication Data Length field is always 16 octets.

routing, crypto

wire-format §2.1

The RIPv2 cryptographic authentication header reuses the 16-octet authentication password field to carry: a 16-bit RIPv2 Packet Length offset, an 8-bit Key ID, an 8-bit Authentication Data Length, a 32-bit non-decreasing Sequence Number, and two reserved zero words. Authentication Type is set to 0x0003. The authentication trailer follows the main packet body.

routing, crypto, security