ChatGPT says that such clauses are typically void in the EU, though they may apply in some cases in the US. Even in the US, the triennial DMCA rule-making has granted broader exemptions for good-faith security research every cycle since 2016.
https://chatgpt.com/share/6838c070-705c-8005-9a88-83c9a5550a...