Skip to content

Commit 76c0c15

Browse files
committed
test: update docker-manager tests for granular workspace mounting
1 parent 4feb0ab commit 76c0c15

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/docker-manager.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ describe('docker-manager', () => {
628628
expect(volumes).toContain('/dev/null:/host/run/docker.sock:ro');
629629
});
630630

631-
it('should mount user home directory under /host when enableChroot is true', () => {
631+
it('should mount workspace directory under /host when enableChroot is true', () => {
632632
const configWithChroot = {
633633
...mockConfig,
634634
enableChroot: true
@@ -637,9 +637,9 @@ describe('docker-manager', () => {
637637
const agent = result.services.agent;
638638
const volumes = agent.volumes as string[];
639639

640-
// Should mount home directory under /host for chroot access (read-write)
641-
const homeDir = process.env.HOME || '/root';
642-
expect(volumes).toContain(`${homeDir}:/host${homeDir}:rw`);
640+
// SECURITY FIX: Should mount only workspace directory under /host for chroot access (not entire HOME)
641+
const workspaceDir = process.env.GITHUB_WORKSPACE || process.cwd();
642+
expect(volumes).toContain(`${workspaceDir}:/host${workspaceDir}:rw`);
643643
});
644644

645645
it('should add SYS_CHROOT and SYS_ADMIN capabilities when enableChroot is true', () => {

0 commit comments

Comments
 (0)