Skip to content

Commit 80bcbbf

Browse files
authored
Hardening note: avoid shell-based popen in InspectFile operator
1 parent 64d43d4 commit 80bcbbf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/operators/inspect_file.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ bool InspectFile::evaluate(Transaction *transaction, const std::string &str) {
6363
std::string res;
6464
std::string openstr;
6565

66+
// SECURITY HARDENING NOTE:
67+
// popen() executes via shell with concatenated arguments.
68+
// Current inputs are engine-controlled, but replacing this
69+
// with argv-based exec/spawn would remove shell parsing risk.
70+
71+
6672
openstr.append(m_param);
6773
openstr.append(" ");
6874
openstr.append(str);

0 commit comments

Comments
 (0)