security: sanitize markdown output and harden unix socket permissions
- Add isomorphic-dompurify to sanitize rendered docs HTML - Tighten SocketServerJson socket permissions from 777 to 660 - Keep package.json version at 1.1.16 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -27,12 +27,14 @@ class SocketServerJson {
|
||||
this.onClientClose = new CallbackQueue(args.onClientClose);
|
||||
this.onClientError = new CallbackQueue(args.onClientError);
|
||||
|
||||
// Set socket file permissions after listening
|
||||
// 777 is acceptable here for single-use container environments
|
||||
// Wrapped in try-catch as chmod may fail in test/restricted environments
|
||||
// Set socket file permissions after listening. 660 (owner + group read/write)
|
||||
// is the safest default; the Docker image runs both processes as root, and
|
||||
// bare-metal operators should ensure the proxy service and openresty share a
|
||||
// group when running as separate users. Wrapped in try-catch as chmod may
|
||||
// fail in test/restricted environments.
|
||||
this.onListen.push(() => {
|
||||
try {
|
||||
fs.chmodSync(this.socketFile, '777');
|
||||
fs.chmodSync(this.socketFile, '660');
|
||||
} catch(err) {
|
||||
// Chmod may fail in test environments or certain filesystems
|
||||
// Socket will still work with default permissions
|
||||
|
||||
Reference in New Issue
Block a user