subprocess module call
Medium
- Category
- Dangerous Code Execution
- Content
try: # Use NQL filter to search for posts with similar title # The ~ operator does a partial match result = subprocess.run( [GHST_BIN, "post", "list", "--filter", f"title:~'{title[:30]}'", "--json"], capture_output=True, text=True,- Confidence
- 92% confidence
- Finding
- The code builds a Ghost CLI filter argument directly from newsletter-derived title text using embedded single quotes. Even though subprocess.run is called without a shell, this is still an argument-injection risk against the ghst/NQL parser: crafted title content can break out of the intended filter expression, alter query semantics, or cause unexpected matches/behavior in the downstream tool.
