Skip to content

권한 & 샌드박스

This content is not available in your language yet.

신뢰할 수 없는 웹 콘텐츠를 로드할 수 있는 렌더러가 네이티브 자원에 접근하는 경계를 통제합니다. backend SDK 호출은 신뢰 코드라 항상 우회(thread-local 마커).

config.fs.allowedRoots 화이트리스트로 렌더러 fs.* 를 검증.

설정렌더러 동작
미설정 / []모든 fs.* 차단 → error:"forbidden" (default-safe)
["~/Documents/myapp"]해당 prefix 안 path 만 허용(~ 사전 expand)
["*"]escape hatch(.. traversal 은 여전히 차단)

.. path component 는 모든 모드에서 항상 차단. prefix 매치는 separator boundary 가드(/foo/bar 허용 시 /foo/barX 통과 X).

shell.openExternal(URL glob)·shell.openPath/showItemInFolder/trashItem(path) 와 dialog open/save 의 defaultPath 를 동일 메커니즘으로 게이트. fs 와 달리 opt-in — 키 부재 시 레거시 무제한(비파괴), 존재 시 enforce([]=deny-all / ["*"]=allow / 특정=제한).

{ "shell": { "allowedPaths": ["~/Documents/x"],
"allowedExternalUrls": ["https://*.example.com/*"] },
"dialog": { "allowedPaths": ["~/Documents"] } }

캡처/인쇄/nativeImage 경로 게이트

섹션 제목: “캡처/인쇄/nativeImage 경로 게이트”

print_to_pdf·capture_page·desktop_capturer_capture_thumbnail(쓰기)와 native_image_get_size·native_image_to_png|jpeg(읽기 — 파일을 base64 로 렌더러에 반환 = 내용 유출 가능)도 fs 우회를 막기 위해 동일 allowedRoots 경계로 게이트(rendererPathFsGate). opt-in(설정 시 fs.* 와 동일 경계).

모바일에서도 데스크톱과 같은 권한 게이트가 적용됩니다 — iOS·Android 호스트가 네이티브 액션 직전에 정책을 확인합니다. 키가 없으면 허용, 있으면 enforce 하는 uniform opt-in 방식으로, OS 앱 샌드박스 위에 더해지는 방어선입니다.