Urgent.News

What's breaking now, across thousands of outlets.

Tech

I tried to check if our new blockchain tools were being used. The tool that would have told me was also silently broken — and so were two other things.

The tool I built to check if anyone used our API was itself silently broken — and so were two other things security #cloudflare #webdev #serverless Yesterday I shipped three new endpoints (a Cosmos SDK transaction decoder, an EVM address OFAC sanctions check, and a CometBFT RPC safety auditor). Today I wanted a simple answer: is anyone actually calling them? We have a /api/api-stats endpoint for…

I attempted to verify if our newly implemented blockchain tools were being utilized. The tool designed to determine API usage was also broken, along with two other components.

I recently deployed three new endpoints, including a Cosmos SDK transaction decoder, an EVM address OFAC sanctions check, and a CometBFT RPC safety auditor. I sought a simple answer regarding whether anyone was actually utilizing these endpoints. Our /api/api-stats endpoint was designed precisely for this purpose, reading usage counters from a Cloudflare KV namespace.

However, upon calling the endpoint, I encountered an error stating "Cannot read properties of undefined (reading list)". The error originated from a missing environment variable in production, env.PRESEND_ANALYTICS. While fail-open design principles prevent the entire system from crashing, it also leads to a lack of visibility when the issue arises.

Upon inspecting the Cloudflare dashboard, I discovered that the KV namespace indeed existed, but it had not been bound to the Pages project. The wrangler.toml requirement, which I was unaware of, was the culprit. Once the API-stats endpoint was bound, it revealed that there were 4,852 real API calls over a three-week period, contrary to my initial assumption that it was only a listing exercise.

Furthermore, I found that rate limiting on every endpoint had been ineffective due to the same silent failure. This issue was compounded when I checked the feedback form. The database backing /api/feedback, a D1 instance, had no tables and had been silently discarding all submissions since launch, except for a single row from mid-August that predated the binding failure.

After fixing the binding, I ran the missing CREATE TABLE command and tested the feedback form. The form encountered an error, but there were no error details provided. Upon manual intervention, I discovered that the Turnstile security widget was blocked from loading due to a mismatch between the CSP header and the Turnstile secret key. The anti-bot widget was being blocked by our own security header since the feedback feature's launch.

In summary, four separate bugs, occurring within a short timeframe, all exhibited the same failure pattern: they were silent, designed to prevent crashes, and indistinguishable from "everything is fine" unless specifically checked. While fail-open design is appropriate for user-facing behavior, it necessitates an additional, conspicuous check to ensure the bindings are present.

This check should be executed on a regular schedule and alert the relevant personnel when the answer is "missing" rather than relying on manual inspection of the /api/api-stats endpoint.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

The configuration we changed in June arrived one pod at a time in August

A support ticket said our dispatch emails were going out twice. Not always, not to any customer we could pick out, and never while we watched.

  • Configuration change from ten to two minutes occurred in June
  • Node pool upgrade in August caused mixed lease durations
  • Annotation and metric implementation resolved configuration issue

OPPO A7 Pro Series Launches In Malaysia

OPPO has officially launched the A7 Pro Series in Malaysia, comprising the A7 Pro 5G and A7 Pro Max 5G. Both models target the mid-range segment, with large-capacity batteries and ergonomic designs…

Project LifeOps (Part 5): 24/7 Zero-Cost Cloud Deployment ($0/month), Mobile Optimization, and PWA

We have arrived at the grand finale of our engineering series. Across the four previous installments, we designed the database architecture and FastAPI backend , crafted the Glassmorphism Dark Mode…

  • Production-ready cloud topology with $0/month cloud free tiers
  • Mobile-optimized Progressive Web App accessible via https://datalaria.com/apps/lifeops/
  • Backend built with FastAPI + Uvicorn, JWT bearer tokens, and Supabase Cloud PostgreSQL

One new label multiplied our metrics by every order we take

On a Friday afternoon a colleague added a label to a counter so he could follow one customer's orders through a queue. The label was the order id.

  • A single label exponentially increased metrics with every order
  • Label review took only four minutes due to brevity
  • Failure caused metrics server to restart in a loop

More from Saturday 19 September →