Urgent.News

What's breaking now, across hundreds of outlets.

Tech

WWW-Authenticate challenge order is security policy

WWW-Authenticate challenge order is security policy An HTTP 401 response tells a client that authentication is required. The WWW-Authenticate header tells it which schemes the server accepts. That header often contains more than one challenge. The client chooses among them, and the server should not assume the choice is the strongest option it advertised. RFC 9110 requires an origin server to…

The order in which HTTP servers present authentication challenges, such as in a 401 response, has significant security implications. An HTTP 401 tells a client authentication is required and includes a WWW-Authenticate header indicating which authentication schemes the server accepts. This header often contains multiple, comma-separated challenges.

The client chooses which challenge to attempt, but the server should not assume this is the strongest option it advertised. RFC 9110, the latest HTTP standard, requires an origin server to send at least one challenge in a 401 response. The header can appear multiple times, each containing a comma-separated list of challenges.

Parsing challenges can be tricky, as some clients fail when encountering unknown schemes. A common compatibility workaround is listing a widely-supported scheme first, like Basic. However, this can conflict with a security policy that aims to select the strongest available scheme whenever possible. The solution is to separate compatibility considerations from exposure.

If Basic authentication is only supported for legacy clients, it should be scoped to a separate listener or path with documentation and a removal date. Basic authentication, which encodes credentials in a reversible manner, should not be advertised broadly just because an old client struggles to parse a Bearer challenge. The chosen scheme depends on the credential model, and the protected space must be clear through a precise realm.

Multiple realms can complicate challenge reasoning, as a user might be prompted multiple times or a client may cache credentials for the wrong scope. Stable, distinct realms should be used for distinct protection spaces, and realms should not be treated as secrets since they are visible to the client.

Proxy behavior is also crucial. RFC 9110 specifies that a proxy forwarding a response must not modify the WWW-Authenticate header. Reverse proxies that rewrite challenges can disrupt client negotiation or misrepresent the server's supported schemes to browsers. Testing the actual response through every ingress path is recommended, as browser developer tools can show the final scheme list, status code, and redirect chain.

Authentication failures should be logged with the selected scheme, not just the user name. A spike in Basic authentication attempts against a typically Bearer-protected endpoint should be investigated. Rate-limiting repeated failures is also advised to avoid distinguishing between unknown users and wrong credentials.

For high-value actions, a fresh authentication event should be required rather than accepting an old session. The challenge is part of the protocol contract and should remain small, deliberate, and consistent with the credential and transport controls behind it.

Rewritten by urgent.news; may contain errors — check the original.

Read the original at dev.to →

Report a problem with this story

More in Tech

Vibe coding testing: check your app before users do

Originally published at pantheontable.com/blog/vibe-coding-testing-check-your-app-before-users-do Andrej Karpathy vibe coded a website and felt 80% done.

  • Andrej Karpathy built a website using AI and felt 80% complete.
  • AI testing requires giving AI a way to run tests and use the app as a customer.
  • Clicking through app is insufficient; must test for empty forms, double clicks, weak connections.

Fauji Foods Appoints New CEO

Fauji Foods Limited has appointed Haseebullah Zahur as its chief executive officer, effective January 1, 2027, according to a filing … Read More The post Fauji Foods Appoints New CEO appeared first on…

Why your yt-dlp cookies stop working after a day

The fix everyone gives for yt-dlp's "Sign in to confirm you're not a bot" is to pass your YouTube cookies. It works. Then a day or two later the same error is back, with the same cookies.txt, and…

  • YouTube rotates session cookies frequently.
  • Exporting cookies from active browser results in stale session.
  • Use private/incognito window to sign in and export cookies.

Pricing fixed-price software projects with integer arithmetic

A fixed-price contract has two numbers: what the customer pays and what the developer retains. Confusing them creates a budget error before a single line of application code is written.

  • Begin with work breakdown, calculate developer's expected hours and target net amount
  • Apply 12% service fee, calculate gross amount needed to meet target net
  • Define fee contract explicitly using integer cents and percentages as basis points

Stateful Observable: loading, errors and combined data in RxJS without the boilerplate

Why I stopped writing tap(() => this.loading = true) . Every Angular codebase I have worked on has the same few lines somewhere, usually in many places: a loading flag set from a tap , an error field…

  • Stateful Observable simplifies handling loading, error, and combined data in Angular apps
  • Library provides stateful observable with loading, error, and inactive states
  • Reduces boilerplate code and potential issues in Angular applications

More from Saturday 21 November →