Workspace IndexKnowledge Notes › XSS and CSRF — the browser trusts the wrong origin

#237PoC

XSS and CSRF — the browser trusts the wrong origin

Cross-site scripting runs attacker JavaScript in a victim's session and CSRF rides the victim's cookies to act as them; both exploit the browser's trust model, and both matter for any dapp UI.

Not yet scoped.

Why

The PoC shows a stored-XSS payload and a CSRF request, then the defenses (CSP, sanitization, SameSite, tokens) — the front-end half of security a contract audit never covers.

How it works

Not yet built.

Where it lands in Jayverse

  • Wallet: test that a stored-XSS payload elsewhere on jaylabs.xyz cannot reach the signing prompt. The signing call should only be triggerable from Wallet's own trusted script context, not any script running on the page.
  • Rabbit portal: add CSRF tokens and SameSite cookies to every authenticated portal action. Sanitize any user-generated content path — persona bios, market descriptions — before it ships.

Key expressions

Words and phrases from this page worth keeping, with the Korean meaning and the sentence they come from.

Expression뜻 · 쓰이는 자리
ride (someone's cookies)~을 몰래 편승해 이용하다 · CSRF가 피해자의 쿠키를 이용해 요청을 보낼 때. "CSRF rides the victim's cookies"
act as them그 사람인 것처럼 행동하다(사칭하다) · 인증 정보를 도용해 본인처럼 행동할 때. "to act as them"
exploit the trust model신뢰 구조의 허점을 악용하다 · 브라우저가 특정 출처를 무조건 믿는 점을 공격할 때. "both exploit the browser's trust model"
a stored-XSS payload저장형 XSS 공격 코드 · 서버에 영구 저장되어 실행되는 악성 스크립트를 가리킬 때. "a stored-XSS payload and a CSRF request"
never covers전혀 다루지 않다(대상에서 빠져 있다) · 특정 점검 범위가 완전히 놓치는 영역을 말할 때. "a contract audit never covers"
XSS크로스사이트 스크립팅(Cross-Site Scripting) · 공격자 스크립트가 피해자 세션에서 실행되는 취약점. "Cross-site scripting runs attacker JavaScript in a victim's session"
CSRF사이트 간 요청 위조(Cross-Site Request Forgery) · 피해자 쿠키를 이용해 원치 않는 요청을 보내는 공격. "CSRF rides the victim's cookies to act as them"
CSP콘텐츠 보안 정책(Content Security Policy) · 브라우저가 로드할 스크립트 출처를 제한하는 방어 수단. "the defenses (CSP, sanitization, SameSite, tokens)"
SameSite동일 사이트 쿠키 속성(SameSite 쿠키 속성) · 쿠키가 다른 출처로 전송되지 못하게 막는 CSRF 방어 수단. "the defenses (CSP, sanitization, SameSite, tokens)"

← All Knowledge Notes · Workspace Index · Top ↑

XSS와 CSRF — 브라우저가 잘못된 출처를 신뢰한다

크로스사이트 스크립팅은 피해자 세션에서 공격자 자바스크립트를 실행하고 CSRF는 피해자 쿠키를 타고 그를 대신해 행동합니다. 둘 다 브라우저 신뢰 모델을 악용하며 어떤 dapp UI에도 중요합니다.

아직 범위 미정.

이 PoC는 저장형 XSS 페이로드와 CSRF 요청을 보인 뒤 방어책(CSP, 소독, SameSite, 토큰)을 보입니다 — 컨트랙트 감사가 결코 다루지 않는 보안의 프론트엔드 절반입니다.

동작 방식

아직 만들지 않음.

Jayverse에서의 위치

  • Wallet: jaylabs.xyz 다른 곳의 저장형 XSS 페이로드가 서명 프롬프트에 닿지 못하는지 테스트한다. 서명 호출은 페이지에서 실행되는 아무 스크립트가 아니라 오직 Wallet 자신의 신뢰된 스크립트 컨텍스트에서만 트리거되어야 한다.
  • Rabbit 포털: 인증된 모든 포털 액션에 CSRF 토큰과 SameSite 쿠키를 추가한다. 페르소나 소개, 마켓 설명 등 사용자 생성 콘텐츠 경로는 출시 전에 새니타이즈한다.

핵심 표현

이 페이지의 영어 본문에서 배울 만한 단어와 표현, 뜻과 나온 자리.

Expression뜻 · 쓰이는 자리
ride (someone's cookies)~을 몰래 편승해 이용하다 · CSRF가 피해자의 쿠키를 이용해 요청을 보낼 때. "CSRF rides the victim's cookies"
act as them그 사람인 것처럼 행동하다(사칭하다) · 인증 정보를 도용해 본인처럼 행동할 때. "to act as them"
exploit the trust model신뢰 구조의 허점을 악용하다 · 브라우저가 특정 출처를 무조건 믿는 점을 공격할 때. "both exploit the browser's trust model"
a stored-XSS payload저장형 XSS 공격 코드 · 서버에 영구 저장되어 실행되는 악성 스크립트를 가리킬 때. "a stored-XSS payload and a CSRF request"
never covers전혀 다루지 않다(대상에서 빠져 있다) · 특정 점검 범위가 완전히 놓치는 영역을 말할 때. "a contract audit never covers"
XSS크로스사이트 스크립팅(Cross-Site Scripting) · 공격자 스크립트가 피해자 세션에서 실행되는 취약점. "Cross-site scripting runs attacker JavaScript in a victim's session"
CSRF사이트 간 요청 위조(Cross-Site Request Forgery) · 피해자 쿠키를 이용해 원치 않는 요청을 보내는 공격. "CSRF rides the victim's cookies to act as them"
CSP콘텐츠 보안 정책(Content Security Policy) · 브라우저가 로드할 스크립트 출처를 제한하는 방어 수단. "the defenses (CSP, sanitization, SameSite, tokens)"
SameSite동일 사이트 쿠키 속성(SameSite 쿠키 속성) · 쿠키가 다른 출처로 전송되지 못하게 막는 CSRF 방어 수단. "the defenses (CSP, sanitization, SameSite, tokens)"

← 전체 기술 노트 · 워크스페이스 인덱스 · 맨 위 ↑