LPS-38423 Fix security issue when creating / updating folders