Security context

What an agent needs to avoid regressing past fixes and find the next vuln in this repo.

microsoft/promptflow
main @ 3928a72
25
Fixes
1
CVEs
CRITICAL
Peak severity
17.4%
Coverage
Highlights
Information Disclosure: 6 prior fixes. Scrutinize any change in this area.
src/promptflow-core/promptflow/executor/_service/utils/service_utils.py: most-fixed (2 issues). Treat as high-risk during review.
15 high-severity fixes in this history; regressions here are high-impact.
Recurring patterns

The bug types that recur here, drawn from past fixes, not open vulnerabilities.

Remote Code Execution: The prompt parsing utilities dynamically evaluated arbitrary untrusted input strings using Python's 'eval', allowing attackers to execute code. Replacing this with 'ast.literal_eval' and sanitizing input was required.
Server-Side Template Injection: Default rendering with standard 'jinja2.Template' allowed template injection to escalate to RCE. The fix forced execution inside a SandboxedEnvironment across core utilities and tools.
Auth Bypass: Localhost-bound API services trusted client-provided HTTP headers ('X-Remote-User') for user authorization, which could be bypassed by cross-origin attackers. The fix removed reliance on client headers, shifting to WSGI environment checks.