Skip to content

Use execve() to replace system()#4223

Closed
lum1n0us wants to merge 1 commit intobytecodealliance:mainfrom
lum1n0us:fix/reimplement_bh_system
Closed

Use execve() to replace system()#4223
lum1n0us wants to merge 1 commit intobytecodealliance:mainfrom
lum1n0us:fix/reimplement_bh_system

Conversation

@lum1n0us
Copy link
Copy Markdown
Contributor

  • Direct Execution: execve() directly executes a program, bypassing the shell. This avoids vulnerabilities like shell injection, which can occur with system() if user input is not properly sanitized.
  • Controlled Environment: With execve(), you can explicitly specify the environment variables for the new process, providing better control over the execution context.
  • No Shell Overhead: execve() does not invoke a shell, reducing the risk of unintended behavior caused by shell features or configurations.
  • Predictable Behavior: execve() only executes the specified program, whereas system() relies on the shell, which may interpret commands differently based on the shell's configuration or environment.

@lum1n0us lum1n0us force-pushed the fix/reimplement_bh_system branch 2 times, most recently from 36ffe27 to 55ad4b6 Compare April 28, 2025 03:35
@lum1n0us lum1n0us force-pushed the fix/reimplement_bh_system branch from 55ad4b6 to d3a2cdd Compare April 29, 2025 05:31
@lum1n0us lum1n0us marked this pull request as draft May 6, 2025 02:38
@lum1n0us lum1n0us force-pushed the fix/reimplement_bh_system branch 2 times, most recently from 0860f09 to efdba17 Compare May 9, 2025 09:05
- Direct Execution: execve() directly executes a program, bypassing the shell.
  This avoids vulnerabilities like shell injection, which can occur with
  system() if user input is not properly sanitized.
- Controlled Environment: With execve(), you can explicitly specify the
  environment variables for the new process, providing better control over
  the execution context.
- No Shell Overhead: execve() does not invoke a shell, reducing the risk
  of unintended behavior caused by shell features or configurations.
- Predictable Behavior: execve() only executes the specified program, whereas
  system() relies on the shell, which may interpret commands differently
  based on the shell's configuration or environment.
@lum1n0us lum1n0us force-pushed the fix/reimplement_bh_system branch from efdba17 to c1df02f Compare May 9, 2025 09:35
@lum1n0us lum1n0us marked this pull request as ready for review May 14, 2025 00:55
@lum1n0us lum1n0us closed this Sep 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants