Remove or secure development-specific code before deploying to production environments. Development artifacts like debug print statements, weak validation methods, and development endpoints can introduce significant security vulnerabilities.
Remove or secure development-specific code before deploying to production environments. Development artifacts like debug print statements, weak validation methods, and development endpoints can introduce significant security vulnerabilities.
Specifically:
Example of insecure code:
@router.post("/v1/responses")
async def create_responses(request: ResponsesRequest, raw_request: Request):
print(request, raw_request) # INSECURE: Leaks sensitive data to logs
def is_dangerous_cmd(cmd):
cmd_base = os.path.basename(cmd) # INSECURE: Can be bypassed with symlinks
return cmd_base in COMMAND_BLACKLIST
Example of secure code:
@router.post("/v1/responses")
async def create_responses(request: ResponsesRequest, raw_request: Request):
# Debug statements removed for production
def is_dangerous_cmd(cmd):
# Resolve any symlinks to get the real path
real_path = os.path.realpath(cmd)
cmd_base = os.path.basename(real_path)
return cmd_base in COMMAND_BLACKLIST
# When enabling development features:
if envs.VLLM_SERVER_DEV_MODE:
logger.warning("SECURITY WARNING: Development endpoints are enabled!")
# Accompany with tests to verify this warning is present
Enter the URL of a public GitHub repository