mirror of https://github.com/garrytan/gstack.git
fix(security): restrict session file permissions to owner-only
Design session files written to /tmp with default umask (0644) were world-readable on shared systems. Sessions contain design prompts and feedback history. Set mode 0o600 (owner read/write only) on both create and update paths. Closes #859 Co-Authored-By: Gus <garagon@users.noreply.github.com>
This commit is contained in:
parent
d81229f9f2
commit
8697ffa09b
|
|
@ -49,7 +49,7 @@ export function createSession(
|
||||||
updatedAt: new Date().toISOString(),
|
updatedAt: new Date().toISOString(),
|
||||||
};
|
};
|
||||||
|
|
||||||
fs.writeFileSync(sessionPath(id), JSON.stringify(session, null, 2));
|
fs.writeFileSync(sessionPath(id), JSON.stringify(session, null, 2), { mode: 0o600 });
|
||||||
return session;
|
return session;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue