pymetasploit3 versions up to 1.0.6 contain a command injection vulnerability in the console.run_module_with_output() function. This flaw allows attackers to inject newline characters into module options like RHOSTS, disrupting the command structure and causing the Metasploit console to execute unintended commands. This can lead to arbitrary command execution and manipulation of Metasploit sessions.