T09 · Insecure Skill Coding Practices
- Location
scripts/get_gold_fundamental_data.py:30- Finding
Hard-Coded FRED API Key Exposed in Source and Documentation
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This skill appears to fetch and summarize gold-market data as described, but it makes outbound requests and includes an exposed default FRED API key.
Install only if you are comfortable with the skill making outbound HTTPS requests to public financial-data services. Use your own FRED key through a controlled environment variable, avoid passing secrets on the command line, run it in an isolated environment, and treat the output as analysis support rather than financial advice.
scripts/get_gold_fundamental_data.py:30Hard-Coded FRED API Key Exposed in Source and Documentation
requirements.txt:1Unpinned Dependency and Mutable Installation Sources Reduce Supply-Chain Integrity
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.
"sort_order": "desc",
"limit": 2,
}
resp = requests.get(FRED_BASE, params=params, timeout=15)
resp.raise_for_status()
data = resp.json()
obs = data.get("observations", [])
The code largely matches the core purpose of fetching gold fundamental data from macro, COT, ETF, and Fed-related sources and returning JSON. However, the declared description promises more than this script actually does: it says the agent must execute the script and then analyze the output into bullish/bearish/neutral factors, a numeric Fundamental Score, and time-horizon outlooks. None of those outputs are produced by this code chunk. Additionally, there are notable source/behavior discrepancies: the description says Investing.com for upcoming events, while the code uses ForexFactory data via faireconomy.media; and the description says Fed RSS over a 7-day window, while the implementation uses the past 30 days. These are material description-versus-behavior mismatches, even though the overall domain (gold fundamentals) is aligned.
The skill requires executing a Python script that accesses network resources and potentially environment variables, but it does not declare an explicit tool/permission scope. In an agent setting, this weakens sandboxing and reviewability because the runtime may grant broader capabilities than users or orchestrators expect, increasing the risk of unintended outbound access or secret exposure.
The instruction says the agent "must produce this structured output in Vietnamese," which forces a specific language for all uses of the skill. This is a natural-language policy concern because no user opt-in or locale-specific justification is provided elsewhere in the file.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
# ── Configuration ──────────────────────────────────────────────
FRED_API_KEY = os.environ.get("FRED_API_KEY", "01fa16f50b07eb27740820fd1cdecf50")
FRED_BASE = "https://api.stlouisfed.org/fred/series/observations"
CFTC_URL = "https://www.cftc.gov/dea/newcot/f_disagg.txt"
FED_RSS_URL = "https://www.federalreserve.gov/feeds/press_monetary.xml"
SSGA_GLD_URL = "https://www.ssga.com/us/en/intermediary/etfs/spdr-gold-shares-gld"
The README explicitly describes fetching data from multiple external services but does not warn users that running the skill will make outbound network requests and may transmit metadata such as IP address, timing, and possibly API credentials to third parties. In an agent/cron-job context, this matters because execution may be automated and non-interactive, so operators may not realize the skill continuously contacts external domains or relies on third-party data sources.
The dependency is specified as requests>=2.25.0, which allows installation of many future and historical versions without reproducibility or security guarantees. In a skill that fetches remote market and Fed/CFTC/ETF data over the network, leaving a core HTTP client unpinned increases the chance of pulling a vulnerable or behavior-changing release during deployment.
requests>=2.25.0
Because requests is unpinned, the manifest does not prove that deployed environments will avoid versions affected by known advisories. This skill's purpose is to retrieve external data from multiple internet sources, so issues in HTTP handling, redirects, TLS/session behavior, or credential discovery could be relevant if the environment uses .netrc, proxies, redirects, or attacker-controlled URLs/feed content.
The function docstring states it parses the Fed monetary policy RSS feed for the last 7 days, but the code computes thirty_days_ago and includes items from the past 30 days. This is an active contradiction between the inline intent documentation and the implemented behavior.
The manifest and module header say the skill fetches upcoming events from Investing.com, but the actual implementation fetches economic calendar data from faireconomy.media/ForexFactory JSON instead. This is a semantic mismatch in the skill's declared behavior, even though the overall purpose remains gold fundamental data collection.
No suspicious patterns detected.