Skip to content

Conversation

@sirandreww-starkware
Copy link
Contributor

No description provided.

@reviewable-StarkWare
Copy link

This change is Reviewable

Copy link
Contributor Author

sirandreww-starkware commented Jul 29, 2025

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

try:
result = subprocess.run(
cmd,
shell=True,

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Semgrep identified an issue in your code:
Found 'subprocess' function 'run' with 'shell=True'. This is dangerous because this call will spawn the command using a shell process. Doing so propagates current shell settings and variables, which makes it much easier for a malicious actor to execute commands. Use 'shell=False' instead.

To resolve this comment:

✨ Commit Assistant fix suggestion

Suggested change
shell=True,
shell=False,
View step-by-step instructions
  1. Change the value of the shell parameter from True to False in the subprocess.run call.
  2. Change the cmd argument from a single string to a list of command arguments. Break up the string at spaces and make each part an element of the list. For example, cmd = ["cargo", "run", "--bin", "get_peer_id_from_secret_key", secret_key].
  3. Pass this list directly to subprocess.run() as the first argument.
    This prevents the shell from interpreting the command and reduces the risk of shell injection attacks.
💬 Ignore this finding

Reply with Semgrep commands to ignore this finding.

  • /fp <comment> for false positive
  • /ar <comment> for acceptable risk
  • /other <comment> for all other reasons

Alternatively, triage in Semgrep AppSec Platform to ignore the finding created by subprocess-shell-true.

You can view more details about this finding in the Semgrep AppSec Platform.

@github-actions
Copy link

github-actions bot commented Jul 29, 2025

Benchmark movements: No major performance changes detected.

@sirandreww-starkware sirandreww-starkware changed the base branch from main to graphite-base/8303 July 30, 2025 11:28
@sirandreww-starkware sirandreww-starkware force-pushed the 07-29-apollo-network-broadcast-network-stress-test-draft branch from b24e12f to 30f4a37 Compare July 30, 2025 11:28
@sirandreww-starkware sirandreww-starkware changed the base branch from graphite-base/8303 to 07-29-waker-option-instead-of-vec-fix July 30, 2025 11:28
@sirandreww-starkware sirandreww-starkware removed the request for review from ShahakShama July 30, 2025 11:29
@sirandreww-starkware sirandreww-starkware self-assigned this Jul 30, 2025
@sirandreww-starkware sirandreww-starkware changed the base branch from 07-29-waker-option-instead-of-vec-fix to graphite-base/8303 August 6, 2025 18:10
@sirandreww-starkware sirandreww-starkware force-pushed the 07-29-apollo-network-broadcast-network-stress-test-draft branch from 30f4a37 to a604cea Compare August 6, 2025 18:10
@sirandreww-starkware sirandreww-starkware changed the base branch from graphite-base/8303 to 07-31-apollo_network_decreased_hearbeat_length_and_history_and_gossip August 6, 2025 18:10
@sirandreww-starkware sirandreww-starkware changed the base branch from 07-31-apollo_network_decreased_hearbeat_length_and_history_and_gossip to graphite-base/8303 August 11, 2025 05:26
@sirandreww-starkware sirandreww-starkware force-pushed the 07-29-apollo-network-broadcast-network-stress-test-draft branch from a604cea to f9b196a Compare August 11, 2025 05:27
@sirandreww-starkware sirandreww-starkware changed the base branch from graphite-base/8303 to 07-30-apollo_network_turned_off_flood_publish_in_gossipsub August 11, 2025 05:27
@sirandreww-starkware sirandreww-starkware changed the base branch from graphite-base/8303 to 25-sep-17-broadcast-network-stress-test-1 September 17, 2025 10:20
@sirandreww-starkware sirandreww-starkware force-pushed the 07-29-apollo-network-broadcast-network-stress-test-draft branch from 8a0c365 to ed57747 Compare September 29, 2025 07:47
@sirandreww-starkware sirandreww-starkware changed the base branch from 25-sep-17-broadcast-network-stress-test-1 to graphite-base/8303 September 29, 2025 13:17
@sirandreww-starkware sirandreww-starkware force-pushed the 07-29-apollo-network-broadcast-network-stress-test-draft branch from ed57747 to 5ee188a Compare September 30, 2025 05:07
@sirandreww-starkware sirandreww-starkware changed the base branch from graphite-base/8303 to 25-sep-29-bnst-metrics September 30, 2025 05:07
@sirandreww-starkware sirandreww-starkware force-pushed the 07-29-apollo-network-broadcast-network-stress-test-draft branch from 5ee188a to a1645a3 Compare October 15, 2025 06:04
@sirandreww-starkware sirandreww-starkware force-pushed the 07-29-apollo-network-broadcast-network-stress-test-draft branch from a1645a3 to d97f628 Compare October 29, 2025 21:00
@sirandreww-starkware sirandreww-starkware force-pushed the 07-29-apollo-network-broadcast-network-stress-test-draft branch 4 times, most recently from 735f358 to 9024760 Compare November 9, 2025 13:13
@sirandreww-starkware sirandreww-starkware force-pushed the 07-29-apollo-network-broadcast-network-stress-test-draft branch from 9024760 to 92c87f1 Compare November 12, 2025 11:29
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