[P2][auth] SIWE registration 검증을 full EIP-4361 parser/validator 기반으로 보강 #42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
문제
현재 SIWE registration flow는 서버가 생성한 고정 문자열을 challenge에 저장한 뒤,
/sdk/register에서 제출된siwe_message와 exact match를 하고 Ethereumpersonal_sign서명을 검증하는 구조입니다.이 방식은 서버 생성 challenge에 대해서는 동작하지만, EIP-4361 SIWE message를 구조적으로 parse/validate하는 범용 SIWE 검증은 아닙니다.
현재 동작
auth/siwe.rs::build_register_message()가 고정 SIWE-like 문자열 생성leases.rs::consume_verified_challenge()가 저장된 문자열과 제출 문자열 exact matchauth/siwe.rs::verify_personal_signature()가 EIP-191 personal message hash + secp256k1 recovery로 address 검증한계
제안
완료 기준
검토 기준:
portal-relaySIWE registration flow 정적 리뷰. 관련 코드:crates/portal-relay/src/auth/siwe.rs,crates/portal-relay/src/relay/leases.rs,crates/portal-relay/src/api/mod.rs.검토했지만 이번 범위에서는 수용하지 않습니다. 현재 registration은 서버가 생성/저장한 SIWE-like challenge의 exact match와 personal_sign address recovery를 함께 요구하므로, 외부 임의 SIWE message parser가 없어도 현재 프로토콜 보안 결함으로 보기는 어렵습니다. full EIP-4361 parser 도입은 상호운용 확장 과제이며 메시지 shape 변경 회귀 위험이 있어 닫습니다.