Skip to content

Commit 164bd78

Browse files
committed
fix(network-agent): allow single dots in sandboxID, only reject path traversal
The previous validation rejected any sandboxID containing a dot character, which would block legitimate IDs. Now only reject empty strings, path separators, and path-traversal sequences ("..").
1 parent ed3b494 commit 164bd78

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

network-agent/internal/service/state_store.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (s *stateStore) LoadAll() ([]*persistedState, error) {
9292
}
9393

9494
func (s *stateStore) path(sandboxID string) (string, error) {
95-
if strings.ContainsAny(sandboxID, `/\.`) || sandboxID == "" {
95+
if sandboxID == "" || strings.ContainsAny(sandboxID, `/\`) || strings.Contains(sandboxID, "..") {
9696
return "", fmt.Errorf("invalid sandboxID %q: contains path separators or traversal characters", sandboxID)
9797
}
9898
return filepath.Join(s.dir, sandboxID+".json"), nil

0 commit comments

Comments
 (0)