T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/add_product.py:96- Finding
Unrestricted URL Fetching Enables Server-Side Request Forgery
- Content
View full analysis
= 3: try: manual_price = float(sys.argv[2]) except ValueError: print(f"[ERROR] Price must be a number, got: {sys.argv[2]}") sys.exit(1) if len(sys.argv) >= 4: manual_name = sys.argv[3] price = manual_price name = manual_name if price is None or name is None: print(f"[INFO] Fetching page: {url}") html, err = fetch_page(url) ``` ```python # scripts/check_prices.py:225-234 for i, product in enumerate(products): url = product["url"] name = product["name"] old_price = product.get("last_price") or product.get("baseline_price") if i > 0: time.sleep(1) # polite delay between requests print(f"[INFO] Checking: {name}", file=sys.stderr) html, err = fetch_page(url) ``` ### Technical Analysis Both scripts pass user- ...[truncated 2495 chars]- Remediation
View remediation
