ERC-5437: Security Contact Interface
An interface for security notice using asymmetric encryption
Abstract
An interface for security notice using asymmetric encryption. The interface exposes a asymmetric encryption key and a destination of delivery.
Motivation
Currently there is no consistent way to specify an official channel for security researchers to report security issues to smart contract maintainers.
Specification
The key words “MUST”, “MUST NOT”, “REQUIRED”, “SHALL”, “SHALL NOT”, “SHOULD”, “SHOULD NOT”, “RECOMMENDED”, “MAY”, and “OPTIONAL” in this document are to be interpreted as described in RFC 2119.
- Compliant interfaces MUST implement the
getSecurityContact
method.
type
is a one byte data with valid range of [0x10, 0x7f]
. The ranges of [0x00, 0x0f]
and [0x80, 0xff]
are reserved for future extension.
The type
indicates the format of the publicKey
and extraData
in the following way
Type | Encryption scheme | extraData |
---|---|---|
0x10 | GnuPG - RSA/3072 | Email address(es) encoded in format of RFC 2822 |
A new version of this table can be proposed by future EIPs by specifying a new type
number.
- The
publicKey
returned fromgetSecurityContact
MUST follow the encryption scheme specified in the table above.
The following is an example of a publicKey
using RSA/3072
generated via GnuPG in an RFC 20 ASCII-encoding of the public key string:
-
IF
setSecurityContact
is implemented and a call to it has succeeded in setting a new security contact, an eventSecurityContactChanged
MUST be emitted with the identical passed-in-parameters ofsetSecurityContact
-
It's also RECOMMENDED that an on-chain security notify method
securityNotify
to implemented to receive security notice onchain. If it's implemented and a call has succeeded, it MUST emit anOnSecurityNotification
with identical pass-in-parameter data. -
Compliant interfaces MUST implement EIP-165.
- It's recommended to set a bounty policy via
bountyPolicy
method. Theid = 0
is preserved for a full overview, while other digits are used for different individual bounty policies. The returned string will be URI to content of bounty policies. No particular format of bounty policy is specified.
Rationale
- For simplicity, this EIP specifies a simple GPG scheme with a given encryption scheme and uses email addresses as a contact method. It's possible that future EIPs will specify new encryption schemes or delivery methods.
- This EIP adds an optional method,
setSecurityContact
, to set the security contact, because it might change due to circumstances such as the expiration of the cryptographic keys. - This EIP explicitly marks
securityNotify
aspayable
, in order to allow implementers to set a staking amount to report a security vulnerability. - This EIP allows for future expansion by adding the
bountyPolicy
theextraData
fields. Additional values of these fields may be added in future EIPs.
Backwards Compatibility
Currently, existing solutions such as OpenZeppelin use plaintext in source code
It's recommend that new versions of smart contracts adopt this EIP in addition to the legacy @custom:security-contact
approach.
Security Considerations
Implementors should properly follow security practices required by the encryption scheme to ensure the security of the chosen communication channel. Some best practices are as follows:
- Keep security contact information up-to-date;
- Rotate encryption keys in the period recommended by best practice;
- Regularly monitor the channel to receive notices in a timely manner.
Copyright
Copyright and related rights waived via CC0.