Skip to content

fix(symbols): harden safe_ticker_component against '..' traversal, guard dotenv import, and add GCC/MENA currencies & aliases - #1711

Open
mlubbad wants to merge 2 commits into
TauricResearch:0.7.xfrom
mlubbad:fix/symbols-path-traversal-and-mena-aliases
Open

mlubbad wants to merge 2 commits into
TauricResearch:0.7.xfrom
mlubbad:fix/symbols-path-traversal-and-mena-aliases

Conversation

@mlubbad

@mlubbad mlubbad commented Nov 21, 2026

Copy link
Copy Markdown

Summary

  • Security hardening (tradingagents/dataflows/symbols.py): Tightens safe_ticker_component() to reject any value starting with . or containing .. (e.g., .env, a..b), closing path-traversal edge cases that previously bypassed set(value) == {'.'}.
  • MENA / GCC market coverage (symbols.py): Adds Gulf/MENA ISO-4217 currencies (SAR, AED, QAR, OMR, KWD, BHD, EGP, JOD) to _FOREX_CURRENCIES and major regional equity aliases (Tadawul, QSE, MSX, DFM, BIST).
  • Optional dotenv guard (tradingagents/__init__.py): Wraps load_dotenv in try ... except ImportError so lightweight environments without python-dotenv can still import the package cleanly.

Verification

  • Verified safe_ticker_component rejects .hidden and a..b, resolves SARUSD / ARAMCO / THYAO, and imports cleanly without python-dotenv.

… aliases

Signed-off-by: Dr. Mohammed Lubbad <engmlubbad@gmail.com>
@mlubbad
mlubbad changed the base branch from main to 0.7.x November 24, 2026 21:28
@mlubbad

mlubbad commented Nov 24, 2026

Copy link
Copy Markdown
Author

Retargeted the base branch to 0.7.x following the 1.0.0 TypeScript release on main so this Python patch merges cleanly without conflicts, and added unit coverage in tests/test_safe_ticker_component.py and tests/test_symbols.py.

mihaidimoiu added a commit to mihaidimoiu/TradingAgents that referenced this pull request Nov 28, 2026
…e dependencies

Upstream's main is a TypeScript rewrite since 1.0.0; the Python line is its
0.7.x branch, merged before this. From the open Python pull requests:

- TauricResearch#1671 yfinance floor 1.8.0
- TauricResearch#1680 ChatGPT plan: keep the arguments of tool calls made in one turn
- TauricResearch#1681 global news searched by phrase and spread across the topics
- TauricResearch#1682 a windowed indicator is reported only once its window is full
- TauricResearch#1686 the price history window is anchored at the analysis date and the
  cache records the span it was downloaded for (the legacy-cache check
  guarded against a file with no Date column; its tests no longer depend on
  the day they run)
- TauricResearch#1694 Yahoo's free cash flow labelled levered, the standard figure printed
  from the cash-flow statement
- TauricResearch#1695 replace_file removes its temporary file when the write fails
- TauricResearch#1707 Yahoo price rows with no close are dropped and named
- TauricResearch#1711 safe_ticker_component refuses a leading dot and '..'; Gulf currencies
  (its aliases and its dotenv guard left out)
- TauricResearch#1716 an OpenAI-compatible server may be asked for the Responses API, with
  the environment variable the pull request lacked

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant