---
eip: 5437
label: ERC-5437
title: Security Contact Interface
status: Stagnant
type: Standards Track
category: ERC
created: 2022-08-09
requires: 165
official: https://eips.ethereum.org/EIPS/eip-5437
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5437.md
canonical: https://eips.huatuo.xyz/ja/eip-5437/
lang: ja
tldr: 公式の暗号化されたセキュリティ連絡先（GPG 公開鍵とメールアドレス）を公開するコントラクトインターフェース。研究者が脆弱性を非公開で報告する方法を知ることができる。
tags: [security, disclosure, interface, contact]
---

# ERC-5437: Security Contact Interface

> An interface for security notice using asymmetric encryption

**TL;DR:** 公式の暗号化されたセキュリティ連絡先（GPG 公開鍵とメールアドレス）を公開するコントラクトインターフェース。研究者が脆弱性を非公開で報告する方法を知ることができる。

## 何を解決するのか

研究者がデプロイ済みコントラクトのバグを見つけたとき、誰がそれを保守していて、どうすれば非公開で連絡できるのかを知る確実な方法がないことがよくあります。現在の最善の慣習は、ソース内の NatSpec コメント（例: `/// @custom:security-contact someone@example.com`）ですが、ソースが検証済みでなければ役に立たず、暗号化も提供しません。

ERC-5437 は連絡先をオンチェーンに置きます。コントラクト自身が公開鍵と送付先アドレスを返すため、報告を保守者宛てに暗号化できます。

## 仕組み

必須:

- `getSecurityContact(type, data)` が `(type, publicKey, extraData)` を返す。
- コントラクトは [ERC-165](/eip-165/) を実装しなければならない。

`type` は 1 バイトです。有効な値は `0x10`〜`0x7f` で、それ以外は予約されています。仕様が定義しているのは 1 つです。

| タイプ | 暗号化方式 | `extraData` |
| --- | --- | --- |
| `0x10` | GnuPG RSA/3072 | RFC 2822 形式のメールアドレス |

任意:

- 鍵のローテーションのための、`setSecurityContact(type, publicKey, extraData)` と `SecurityContactChanged` イベント。
- `securityNotify(type, data)`: `payable` なオンチェーン通知で、`OnSecurityNotification` を発行する。payable であるため、プロジェクトは報告者にステークを求められる。
- `bountyPolicy(id)`: バグバウンティポリシーへの URI を返す。`id = 0` は概要。

将来の EIP が、他の方式やチャネル向けに新しい `type` の値を追加できます。

## サンプルコード

コントラクトのセキュリティ連絡先を取得する（ethers v6）:

```ts
import { Contract, JsonRpcProvider, toUtf8String } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const target = new Contract(process.env.CONTRACT!, [
  "function getSecurityContact(uint8 t, bytes data) view returns (uint8, bytes, bytes)",
], provider);

const [type, publicKey, extraData] = await target.getSecurityContact(0x10, "0x");
if (Number(type) === 0x10) {
  console.log("GPG key:\n" + toUtf8String(publicKey));   // ASCII-armored key
  console.log("send encrypted report to:", toUtf8String(extraData));
}
```

その鍵で報告を暗号化し（例: `gpg --encrypt --armor -r <key>`）、メールで送ります。

## 知っておくべきこと

- ステータスは **Stagnant** で、インターフェースにはまだ `TODO` の注記が残っています（任意のセッターとバウンティ関数は削除される可能性があります）。シグネチャは、インターフェース内で `public` と書かれ、`type` をパラメーター名に使っているため、そのままではコンパイルできません。
- 仕様は、`@custom:security-contact` コメントも併せて残すことを推奨しています。
- 運用者は連絡先を最新に保ち、妥当なスケジュールで鍵をローテーションし、チャネルを実際に監視しなければなりません。
- 脆弱性の詳細を `securityNotify` で平文のまま送らないでください。オンチェーンのデータは公開されています。


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-5437
