Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tradingagents/agents/managers/risk_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def risk_manager_node(state) -> dict:
risk_debate_state = state["risk_debate_state"]
market_research_report = state["market_report"]
news_report = state["news_report"]
fundamentals_report = state["news_report"]
fundamentals_report = state["fundamentals_report"]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

A high-severity Prompt Injection vulnerability exists here: the risk_manager_node function constructs an LLM prompt by directly embedding unsanitized content from the state object, including reports like market_research_report and fundamentals_report. This allows an attacker to inject malicious instructions and manipulate trading decisions. While the change on line 14 fixes a bug, it is part of this vulnerable data flow. Additionally, the current state access using [] can lead to KeyError if keys are missing; consider using .get() for more robust state access.

sentiment_report = state["sentiment_report"]
trader_plan = state["investment_plan"]

Expand Down