Skip to content

Commit 5f06fdf

Browse files
committed
3466 Add Security Notes
1 parent 8251639 commit 5f06fdf

File tree

12 files changed

+60
-58
lines changed

12 files changed

+60
-58
lines changed

server/ee/libs/automation/automation-configuration/automation-configuration-service/src/main/java/com/bytechef/ee/automation/configuration/facade/ProjectCodeWorkflowFacadeImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@
3838
@Service
3939
@Transactional
4040
@ConditionalOnEEVersion
41-
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
4241
public class ProjectCodeWorkflowFacadeImpl implements ProjectCodeWorkflowFacade {
4342

4443
private final CacheManager cacheManager;
@@ -101,6 +100,11 @@ private Project createProject(long workspaceId, ProjectDefinition projectDefinit
101100
return projectService.create(project);
102101
}
103102

103+
/**
104+
* Security Note: PATH_TRAVERSAL_IN - Temporary files are created with system-generated names in the temp directory,
105+
* not user-controlled paths. Access is restricted to administrators.
106+
*/
107+
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
104108
private ProjectDefinition loadProjectDefinition(Language language, byte[] bytes) throws IOException {
105109
Path path = Files.createTempFile("code_workflow_project", language.getExtension());
106110

server/ee/libs/platform/platform-custom-component/platform-custom-component-configuration/platform-custom-component-configuration-service/src/main/java/com/bytechef/ee/platform/customcomponent/configuration/facade/CustomComponentFacadeImpl.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@
3636
@Service
3737
@Transactional
3838
@ConditionalOnEEVersion
39-
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
4039
public class CustomComponentFacadeImpl implements CustomComponentFacade {
4140

4241
private final CacheManager cacheManager;
@@ -104,6 +103,11 @@ private void create(
104103
customComponentService.create(customComponent);
105104
}
106105

106+
/**
107+
* Security Note: PATH_TRAVERSAL_IN - Temporary files are created with system-generated names in the temp directory,
108+
* not user-controlled paths. Access is restricted to administrators.
109+
*/
110+
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
107111
private ComponentDefinition loadComponentDefinition(Language language, byte[] bytes) throws IOException {
108112
Path path = Files.createTempFile("custom_component", language.getExtension());
109113

server/ee/libs/platform/platform-custom-component/platform-custom-component-loader/src/main/java/com/bytechef/ee/platform/customcomponent/loader/ComponentHandlerLoader.java

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,13 @@
2222
*
2323
* @author Ivica Cardic
2424
*/
25-
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
2625
public class ComponentHandlerLoader {
2726

27+
/**
28+
* Security Note: PATH_TRAVERSAL_IN - URL comes from internal file storage after admin upload, not direct user
29+
* input. Access is controlled through admin-only upload permissions.
30+
*/
31+
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
2832
public static ComponentHandler loadComponentHandler(
2933
URL url, Language language, String cacheKey, CacheManager cacheManager) {
3034

@@ -48,6 +52,11 @@ private static ComponentHandler loadJavaComponentHandler(
4852
}
4953
}
5054

55+
/**
56+
* Security Note: PATH_TRAVERSAL_IN - URL comes from internal file storage after admin upload, not direct user
57+
* input.
58+
*/
59+
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
5160
private static ComponentHandler loadPolyglotComponentHandler(URL url, Language language)
5261
throws URISyntaxException, IOException {
5362

server/libs/atlas/atlas-configuration/atlas-configuration-repository/atlas-configuration-repository-git/src/main/java/com/bytechef/atlas/configuration/repository/git/operations/JGitWorkflowOperations.java

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,6 @@
6262
* @author Arik Cohen
6363
* @author Ivica Cardic
6464
*/
65-
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
6665
public class JGitWorkflowOperations implements GitWorkflowOperations {
6766

6867
private static final Logger log = LoggerFactory.getLogger(JGitWorkflowOperations.class);
@@ -155,8 +154,14 @@ public List<String> getRemoteBranches() {
155154
}
156155
}
157156

157+
/**
158+
* Security Note: PATH_TRAVERSAL_IN - Path traversal is intentional. Paths are derived from Git repository contents,
159+
* not external user input. Access is controlled through Git authentication credentials.
160+
*/
158161
@Override
159-
@SuppressFBWarnings("REC_CATCH_EXCEPTION")
162+
@SuppressFBWarnings({
163+
"REC_CATCH_EXCEPTION", "PATH_TRAVERSAL_IN"
164+
})
160165
public String write(List<WorkflowResource> workflowResources, String commitMessage) {
161166
ReentrantLock lock = getTenantLock();
162167
try {
@@ -347,6 +352,11 @@ private WorkflowResource readBlob(Repository repository, String path, String blo
347352
}
348353
}
349354

355+
/**
356+
* Security Note: PATH_TRAVERSAL_IN - Repository directory is created in a system temp location with a generated
357+
* name, not user-controlled paths.
358+
*/
359+
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
350360
private void clear() {
351361
if (repositoryDir != null) {
352362
org.springframework.util.FileSystemUtils.deleteRecursively(repositoryDir);
@@ -356,6 +366,7 @@ private void clear() {
356366

357367
try {
358368
String tenantKey = TenantCacheKeyUtils.getKey("git");
369+
359370
path = Files.createTempDirectory("jgit_" + tenantKey + "_");
360371
} catch (IOException e) {
361372
throw new RuntimeException(e);

server/libs/modules/components/aws/aws-s3/src/main/java/com/bytechef/component/aws/s3/action/AwsS3ListObjectsAction.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,9 @@ public class AwsS3ListObjectsAction {
6666
.perform(AwsS3ListObjectsAction::perform);
6767

6868
/**
69-
* Performs the S3 list objects operation.
70-
*
71-
* <p>
72-
* <b>Security Note:</b> Path traversal is intentional for this component. The AWS S3 component is designed to allow
73-
* workflow creators to list S3 objects as part of their automation workflows. The prefix is provided by the
74-
* workflow creator, not end users, and access is controlled by AWS IAM credentials configured in the connection.
69+
* Security Note: PATH_TRAVERSAL_IN - Path traversal is intentional. The AWS S3 component allows workflow creators
70+
* to list S3 objects. The prefix is provided by the workflow creator, not end users. Access is controlled by AWS
71+
* IAM credentials configured in the connection.
7572
*/
7673
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
7774
protected static List<S3ObjectDescription> perform(

server/libs/modules/components/filesystem/src/main/java/com/bytechef/component/filesystem/action/FilesystemGetParentFolderAction.java

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -54,18 +54,9 @@ private FilesystemGetParentFolderAction() {
5454
}
5555

5656
/**
57-
* Gets the full path from a full filename, which is the prefix + path, and also excluding the final directory
58-
* separator.
59-
*
60-
* <p>
61-
* This method will handle a file in either Unix or Windows format. The method is entirely text based and returns
62-
* the text before the last forward or backslash.
63-
*
64-
* <p>
65-
* <b>Security Note:</b> Path traversal is intentional for this component. The Filesystem component is designed to
66-
* allow workflow creators to access file paths as part of their automation workflows. Access to this component
67-
* should be restricted through workflow-level permissions and proper access control. The file path is provided by
68-
* the workflow creator, not end users.
57+
* Security Note: PATH_TRAVERSAL_IN - Path traversal is intentional. The Filesystem component allows workflow
58+
* creators to access file paths. Access is controlled through workflow-level permissions. The file path is provided
59+
* by the workflow creator, not end users.
6960
*/
7061
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
7162
protected static String perform(

server/libs/modules/components/filesystem/src/main/java/com/bytechef/component/filesystem/action/FilesystemLsAction.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,8 @@ private FilesystemLsAction() {
7777
}
7878

7979
/**
80-
* Lists files at the given path.
81-
*
82-
* <p>
83-
* <b>Security Note:</b> Path traversal is intentional for this component. The Filesystem component is designed to
84-
* allow workflow creators to access files and directories as part of their automation workflows. Access to this
85-
* component should be restricted through workflow-level permissions and proper access control. The path is provided
80+
* Security Note: PATH_TRAVERSAL_IN - Path traversal is intentional. The Filesystem component allows workflow
81+
* creators to list files/directories. Access is controlled through workflow-level permissions. The path is provided
8682
* by the workflow creator, not end users.
8783
*/
8884
@SuppressFBWarnings("PATH_TRAVERSAL_IN")

server/libs/modules/components/filesystem/src/main/java/com/bytechef/component/filesystem/action/FilesystemMkdirAction.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -54,16 +54,9 @@ private FilesystemMkdirAction() {
5454
}
5555

5656
/**
57-
* Creates a directory by creating all nonexistent parent directories first.
58-
*
59-
* <p>
60-
* An exception is not thrown if the directory could not be created because it already exists.
61-
*
62-
* <p>
63-
* <b>Security Note:</b> Path traversal is intentional for this component. The Filesystem component is designed to
64-
* allow workflow creators to create directories as part of their automation workflows. Access to this component
65-
* should be restricted through workflow-level permissions and proper access control. The path is provided by the
66-
* workflow creator, not end users.
57+
* Security Note: PATH_TRAVERSAL_IN - Path traversal is intentional. The Filesystem component allows workflow
58+
* creators to create directories. Access is controlled through workflow-level permissions. The path is provided by
59+
* the workflow creator, not end users.
6760
*/
6861
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
6962
protected static String perform(

server/libs/modules/components/filesystem/src/main/java/com/bytechef/component/filesystem/action/FilesystemReadFileAction.java

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -54,13 +54,9 @@ private FilesystemReadFileAction() {
5454
}
5555

5656
/**
57-
* Reads the file at the given path.
58-
*
59-
* <p>
60-
* <b>Security Note:</b> Path traversal is intentional for this component. The Filesystem component is designed to
61-
* allow workflow creators to access files as part of their automation workflows. Access to this component should be
62-
* restricted through workflow-level permissions and proper access control. The file path is provided by the
63-
* workflow creator, not end users.
57+
* Security Note: PATH_TRAVERSAL_IN - Path traversal is intentional. The Filesystem component allows workflow
58+
* creators to access files. Access is controlled through workflow-level permissions. The file path is provided by
59+
* the workflow creator, not end users.
6460
*/
6561
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
6662
protected static FileEntry perform(

server/libs/modules/components/filesystem/src/main/java/com/bytechef/component/filesystem/action/FilesystemRmAction.java

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -59,16 +59,9 @@ private FilesystemRmAction() {
5959
}
6060

6161
/**
62-
* Deletes a file, never throwing an exception. If a file is a directory, delete it and all subdirectories.
63-
*
64-
* <p>
65-
* A directory to be deleted does not have to be empty.
66-
*
67-
* <p>
68-
* <b>Security Note:</b> Path traversal is intentional for this component. The Filesystem component is designed to
69-
* allow workflow creators to delete files and directories as part of their automation workflows. Access to this
70-
* component should be restricted through workflow-level permissions and proper access control. The path is provided
71-
* by the workflow creator, not end users.
62+
* Security Note: PATH_TRAVERSAL_IN - Path traversal is intentional. The Filesystem component allows workflow
63+
* creators to delete files/directories. Access is controlled through workflow-level permissions. The path is
64+
* provided by the workflow creator, not end users.
7265
*/
7366
@SuppressFBWarnings("PATH_TRAVERSAL_IN")
7467
protected static Boolean perform(

0 commit comments

Comments
 (0)