Skip to content

fix: Make subprocess shell usage explicit in fm11rf08s_recovery.py#3345

Closed
orbisai0security wants to merge 2 commits into
RfidResearchGroup:masterfrom
orbisai0security:fix-v-003-client-pyscripts-fm11rf08s-recovery.py
Closed

fix: Make subprocess shell usage explicit in fm11rf08s_recovery.py#3345
orbisai0security wants to merge 2 commits into
RfidResearchGroup:masterfrom
orbisai0security:fix-v-003-client-pyscripts-fm11rf08s-recovery.py

Conversation

@orbisai0security
Copy link
Copy Markdown
Contributor

@orbisai0security orbisai0security commented Jun 2, 2026

Hardening: explicitly set `shell=False` on all `subprocess.run()` calls in `fm11rf08s_recovery.py`.

All four call sites already pass `cmd` as a Python list, so Python's default of `shell=False` means there is no active command-injection risk. This change makes the security intent explicit, prevents accidental future regression if a call site is later changed to pass a string, and improves code clarity.

No functional behaviour is changed.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

You are welcome to add an entry to the CHANGELOG.md as well

@iceman1001 iceman1001 requested a review from doegox June 2, 2026 08:46
@iceman1001
Copy link
Copy Markdown
Collaborator

@doegox this one is for you. I mean we do already allow for cmd prompts in the client with ! but it's never wrong to sanitizet too.

@orbisai0security orbisai0security changed the title fix: sanitize shell/subprocess call in fm11rf08s_recovery.py fix: Make subprocess shell usage explicit in fm11rf08s_recovery.py Jun 2, 2026
@orbisai0security
Copy link
Copy Markdown
Contributor Author

Thanks for taking a look.

I re-reviewed the changed call sites and agree the original risk is lower than my PR description suggested: these calls already pass argv lists to subprocess.run(), and shell=False is the Python default. So this is better framed as an explicit hardening/clarity change rather than a confirmed high-severity command-injection fix.

I’m happy to update the PR description accordingly, and I can also remove the regression test if it does not fit the project’s test structure.

@doegox
Copy link
Copy Markdown
Contributor

doegox commented Jun 2, 2026

ok please rephrase and remove the test

…ions

The test targeted a non-existent function (recover_card vs recovery),
used pytest while the project uses unittest, and was placed in a new
top-level tests/ directory not wired into pm3_tests.sh.
The shell=False change is hardening-only; no regression test is needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@orbisai0security
Copy link
Copy Markdown
Contributor Author

ok please rephrase and remove the test

done. Pls review.

@doegox
Copy link
Copy Markdown
Contributor

doegox commented Jun 2, 2026

merged, thank you

@doegox doegox closed this Jun 2, 2026
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