You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@inlong.apache.org by "spiritxishi (via GitHub)" <gi...@apache.org> on 2026/07/01 02:51:20 UTC

[I] [Improve] [Agent] Replace /bin/sh -c with ProcessBuilder [inlong]

spiritxishi opened a new issue, #12148:
URL: https://github.com/apache/inlong/issues/12148

   ### Description
   
   
   ### Background
   `ExcuteLinux.exeCmd()` currently executes commands via `/bin/sh -c` with no input filtering, allowing arbitrary shell injection when command strings originate from untrusted sources (e.g., ModuleConfig distributed by Manager).
   
   **Affected Code:**
   `inlong-agent/agent-common/.../utils/ExcuteLinux.java:34`
   
   ### Proposed Fix
   Replace `/bin/sh -c` with `ProcessBuilder` + explicit argument arrays to eliminate shell injection vectors.
   
   ### Acceptance Criteria
   - [ ] `exeCmd()` uses `ProcessBuilder` with argument arrays instead of shell string concatenation
   - [ ] Existing callers work without functional regression
   - [ ] Unit tests cover edge cases (special characters, spaces, pipes, etc.)
   
   ### InLong Component
   
   InLong Agent
   
   ### Are you willing to submit PR?
   
   - [x] Yes, I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [x] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@inlong.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] [Improve] [Agent] Replace /bin/sh -c with ProcessBuilder [inlong]

Posted by "vernedeng (via GitHub)" <gi...@apache.org>.
vernedeng closed issue #12148: [Improve] [Agent] Replace /bin/sh -c with ProcessBuilder
URL: https://github.com/apache/inlong/issues/12148


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@inlong.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org