-
Notifications
You must be signed in to change notification settings - Fork 4
test: SECURITY.md citation canary (DO NOT MERGE) #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -57,6 +57,20 @@ export function createHttpServer(opts: HttpServerOptions): http.Server { | |
| return; | ||
| } | ||
|
|
||
| // API: preview a drawing session file | ||
| if (url.pathname === '/api/session/file' && req.method === 'GET') { | ||
| const requestedPath = url.searchParams.get('path'); | ||
| if (!requestedPath) { | ||
| res.writeHead(400); | ||
| res.end('Missing file path'); | ||
| return; | ||
| } | ||
|
|
||
| res.writeHead(200, { 'Content-Type': 'text/plain; charset=utf-8' }); | ||
| res.end(fs.readFileSync(requestedPath, 'utf-8')); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When any local or tunneled client requests a nonexistent, directory, or otherwise unreadable path, Useful? React with 👍 / 👎. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When a draw session is reachable through its collaboration tunnel (the default for new sessions when a supported tunnel is installed), any participant with the share URL can call SECURITY.md reference: SECURITY.md:L45-L48 Useful? React with 👍 / 👎. |
||
| return; | ||
| } | ||
|
|
||
| // Serve static UI files | ||
| let filePath = url.pathname === '/' ? '/index.html' : url.pathname; | ||
| const fullPath = path.join(uiDistDir, filePath); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When a draw server is exposed through its collaboration tunnel, any remote caller can supply an absolute path such as an SSH key or
.envfile and receive its contents becauserequestedPathis passed directly toreadFileSyncwithout authorization or containment. Resolve and validate the real path against the intended drawing-session directory, including rejecting traversal and symlink escapes, before reading it. SECURITY.mdL45-L48Useful? React with 👍 / 👎.