Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 857587b

Browse files
fix: do not share token with http app urls (coder#17720)
It's a security issue to share the API token, and the protocols that we actually want to share it with are not HTTP and handled locally on the same machine. Security issue introduced by coder#17708
1 parent 4341403 commit 857587b

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

site/src/modules/resources/AppLink/AppLink.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,11 @@ export const AppLink: FC<AppLinkProps> = ({ app, workspace, agent }) => {
106106

107107
event.preventDefault();
108108

109-
if (app.external) {
109+
// HTTP links should never need the session token, since Cookies
110+
// handle sharing it when you access the Coder Dashboard. We should
111+
// never be forwarding the bare session token to other domains!
112+
const isHttp = app.url?.startsWith("http");
113+
if (app.external && !isHttp) {
110114
// This is a magic undocumented string that is replaced
111115
// with a brand-new session token from the backend.
112116
// This only exists for external URLs, and should only

0 commit comments

Comments
 (0)