question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Stop setting Expect-CT by default

See original GitHub issue

We may want to remove support for the Expect-CT header in Helmet 5.

From MDN:

The Expect-CT will likely become obsolete in June 2021. Since May 2018 new certificates are expected to support SCTs by default. Certificates before March 2018 were allowed to have a lifetime of 39 months, those will all be expired in June 2021.

The OWASP Secure Headers Project says something similar.

First, we should make sure that it’s okay to remove Expect-CT. Will removing it cause any harm? If so, we should abandon this work and continue to maintain it.

If we can remove it, we should:

  1. Remove the Expect-CT middleware (git rm -r middlewares/expect-ct)
  2. Remove the middleware-specific tests (git rm test/expect-ct.test.ts)
  3. Remove the top-level tests (see test/index.ts)
  4. Remove it from the top-level middleware (see index.ts)
  5. Remove it from the published allowlist (see .npmignore)
  6. Update the changelog and documentation

After this is done, git grep -i expect-ct and git grep -i expectct should only return results in the changelog. And this change should be made against the v5.x branch, not main.

But again, we shouldn’t do any of this if Expect-CT shouldn’t be removed.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

2reactions
EvanHahncommented, Nov 17, 2021

I’m planning the next major version of Helmet, version 5. I’m trying to decide what to do with Expect-CT in that version. I see three options:

  1. Keep things as is: set the Expect-CT header by default and allow users to set it.
  2. Disable the Expect-CT header by default and allow users to explicitly enable it.
  3. Completely remove Expect-CT from the codebase.

There still seems to be some benefit to the header and I want to minimize disruption, so I think I’m going to go with the first option (keeping things as is). We can re-evaluate this in Helmet version 6.

If anyone disagrees with that plan, let me know!

2reactions
EvanHahncommented, Jul 15, 2021

I agree 100%. However, I want to make sure it’s okay to delete. Based on my very quick research, it seems like the above links haven’t been updated to say something like, “this is now deprecated”.

I’m away from reliable internet this week, so if someone could find definitive sources that claim we can drop this header, I’d appreciate it! Once we’ve decided we can remove it, we’ll start logging deprecation warnings and so on.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Expect-CT - HTTP - MDN Web Docs - Mozilla
Certificate Transparency (CT) aims to prevent the use of misissued ... all new TLS certificates are expected to support SCTs by default.
Read more >
Helmet
Helmet helps you secure your Express.js apps by setting various HTTP headers. It's not a silver bullet, but it can help!
Read more >
Setting Aside A Civil Default Judgment
If you do not think the default judgment was appropriately entered against you, you must file a motion with the court asking the...
Read more >
Adding Expect-CT header to HTTP response
So because certificates are expected to support SCTs by default I do not think that this header makes any sense. When it comes...
Read more >
Is the Expect-CT HTTP header still relevant in 2021?
The Expect-CT will likely become obsolete in June 2021. Since May 2018 new certificates are expected to support SCTs by default. Certificates ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found