forked from baron/baron-sso
백채널 로그아웃 URI 허용 범위 확장
This commit is contained in:
@@ -288,7 +288,26 @@ function isValidBackchannelLogoutUrl(value: string): boolean {
|
||||
if (url.protocol !== "http:") {
|
||||
return false;
|
||||
}
|
||||
return url.hostname === "localhost" || url.hostname === "127.0.0.1";
|
||||
const host = url.hostname.toLowerCase();
|
||||
if (
|
||||
host === "localhost" ||
|
||||
host === "127.0.0.1" ||
|
||||
host === "::1" ||
|
||||
host === "host.docker.internal"
|
||||
) {
|
||||
return true;
|
||||
}
|
||||
if (/^\d+\.\d+\.\d+\.\d+$/.test(host)) {
|
||||
return (
|
||||
host.startsWith("10.") ||
|
||||
host.startsWith("192.168.") ||
|
||||
/^172\.(1[6-9]|2\d|3[0-1])\./.test(host) ||
|
||||
host.startsWith("169.254.")
|
||||
);
|
||||
}
|
||||
// Docker service names and other single-label local hosts are allowed
|
||||
// only for HTTP local development use.
|
||||
return !host.includes(".");
|
||||
} catch {
|
||||
return false;
|
||||
}
|
||||
@@ -949,7 +968,7 @@ function ClientGeneralPage() {
|
||||
throw new Error(
|
||||
t(
|
||||
"msg.dev.clients.general.backchannel_logout.invalid",
|
||||
"Back-Channel Logout URI 형식이 올바르지 않습니다. 운영 환경은 https, 로컬 개발 환경은 localhost/127.0.0.1의 http만 허용됩니다.",
|
||||
"Back-Channel Logout URI 형식이 올바르지 않습니다. 운영 환경은 https를 사용하고, 로컬 개발 환경은 localhost/127.0.0.1, host.docker.internal, Docker 서비스명, 사설 IP의 http만 허용됩니다.",
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -1590,7 +1609,7 @@ function ClientGeneralPage() {
|
||||
<p className="text-xs text-destructive">
|
||||
{t(
|
||||
"msg.dev.clients.general.backchannel_logout.invalid",
|
||||
"Back-Channel Logout URI 형식이 올바르지 않습니다. 운영 환경은 https, 로컬 개발 환경은 localhost/127.0.0.1의 http만 허용됩니다.",
|
||||
"Back-Channel Logout URI 형식이 올바르지 않습니다. 운영 환경은 https를 사용하고, 로컬 개발 환경은 localhost/127.0.0.1, host.docker.internal, Docker 서비스명, 사설 IP의 http만 허용됩니다.",
|
||||
)}
|
||||
</p>
|
||||
) : null}
|
||||
|
||||
Reference in New Issue
Block a user