Dev.to Security 🔐 Cybersecurity 👁 0 📖 4 min read

A critical NGINX flaw was #3 in my news digest's ranking and reached none of my readers

I run devdigest.io, a daily tech news email for developers. Every morning it collects stories from more than 150 sources, scores them, and builds a separate digest for each reader. Free readers get 5 stories a day. Paid

I run devdigest.io, a daily tech news email for developers. Every morning it collects stories from more than 150 sources, scores them, and builds a separate digest for each reader. Free readers get 5 stories a day. Paid readers pick their topics and get up to 20.

On 19 November a 10-year-old NGINX HTTP/2 flaw was published: unauthenticated attackers could execute code on servers. My own VPS runs NGINX, so that morning I turned HTTP/2 off and installed Ubuntu's fixed package once it was out. The story was number 3 in my general ranking for the day.

Then I checked who actually received it. It was in none of that morning's personal digests.

One day is an anecdote, so I counted 15

I went back over 15 mornings (11 to 25 November) and checked every Security story that made the general top 15 against what readers really got.

  • 40 Security stories made the general top 15. 25 of them reached no reader.
  • 9 were in the top 3. 5 of those reached no reader.
  • On four mornings almost nobody got any Security story at all, and on one of them nobody did.

So the NGINX story was not unlucky. Something structural was going on.

Why it happened

Most of my readers are on the free tier. A free digest has 5 slots and there are about 12 topics. To keep it varied, it takes one story per topic, and the five stories are the best story from each of the five best topics.

That means Security goes in or out as one block. If its best story does not beat the fifth topic's best story, no free reader gets any Security that day. On one morning Security's best scored 74, tied with Robotics for fifth place, and lost the tie. On 24 November it came seventh.

It also means a second Security story never gets in. On 19 November Security did make the five, but with a different story, and NGINX was the second one.

Paid readers have a different limit. I allow one story per source in a digest, so the same outlet cannot fill half of it. The Hacker News also had an actively exploited Apache Roller flaw that day, which scored higher, so NGINX lost that place too.

The first fix I tried did nothing useful

My first idea was a score bonus for critical flaws: titles that say "critical", "unauthenticated", "remote code execution", CVSS 9 or 10, and so on. I already have a +15 bonus for flaws that are being exploited in the wild, so this looked like the natural extension.

Before shipping anything I replay it. The replay takes every real digest from those 15 days and runs it again through the real selection code, with each reader's own settings, history and send time. As a sanity check, the unchanged replay reproduced 95.4% of the slots readers actually received.

With a +15 critical bonus, NGINX would have reached most of the digests on 19 November. But across the whole fortnight the number of digests with a Security story did not change at all. All but one of the changed slots swapped one Security story for another. On 5 of the 6 days where it changed something, it pushed out a flaw that was already being exploited and put in one that was not. For a reader, that is a step backwards. The real limit was the single slot, and the score could not change that.

What I shipped instead

The rule is small. If a free digest has no Security story, and the reader's pool has a flaw that is actively being exploited, that flaw takes the fifth slot. "Actively exploited" uses the same title check as my existing bonus: the title has to say the flaw is being exploited and name a flaw, and hedged titles like "exploits may emerge soon" do not count. The flaw also cannot come from a source that is already in the digest.

if no security story in the five and the pool has an exploited flaw:
    security = select(reader_pool, topics={"Security"}, top_n=6)
    flaw = first exploited story in security from a new source
    if flaw:
        five = five[:4] + [flaw]

Replayed over the same 15 mornings:

  • Free readers got a Security story on all 15 mornings instead of 12.
  • About 2% of slots changed. What left: an Arm post about virtual machines, a Gazebo project meeting-minutes post, and an article about an AI code review tool.
  • No digest got shorter, and paid digests did not change.

I also ran the real pool of 25 November through the real send code with the email step replaced by a capture. Every free reader got the exploited N-able MailAssure flaw in place of the code review article. In reality none of them had a Security story that morning.

And NGINX? It still would not make it. That day the same outlet also had an Apache Roller flaw that was already being exploited and needed no login. If I can only give a free reader one security story, I think that is the right one.

What I take from it

Ranking and reach are different numbers. A story can be number 3 for the day and still reach nobody, because the composition rules decide which slots exist before the score is used. I only found this because I checked what the archive says readers received, not what the ranking said they should see.

The other lesson is about testing. The bonus looked right and would have made the one story I cared about show up. Only the replay showed it was moving stories around inside a slot that was already full.

If you want to see what the digest looks like, there is a sample at devdigest.io.

📰 Read the original article on Dev.to Security

Originally published by Dev.to Security. Aggregated on AIWithGhost for educational purposes — full credit and traffic to the original publisher.