NCSC warns organisations to ditch Python 2 before it hits end of life

The National Cyber Security Centre (NCSC) has advised organisations still using Python 2 code to port it to Python 3 as soon as possible before it goes end of life at the turn of the new year.
The cyber security arm of GCHQ said that because Python's core developers will stop working on updates, vulnerabilities in the code will go unpatched and leave organisations vulnerable to cyber attacks.
Moreover, if an organisation is maintaining a library written in Python 2 that other people depend on, then those dependencies are being delayed in their own upgrades which, in turn, adversely affects their cyber security resilience.
"If you continue to use unsupported modules, you are risking the security of your organisation and data, as vulnerabilities will sooner or later appear which nobody is fixing," said the NCSC in a blog post.
Outlining the scale of the problem, the NCSC showed data from June 2019 of the ten most popular Python packages downloaded by millions every month. It showed the majority of the packages were still written predominantly in Python 2 and the ones like Flask which were written mainly in Python 3, still had around a third of their content in the soon-to-be EOL version.
"Even if only a portion of these downloads are being used in live projects, the Python 2 EOL could potentially affect the security of millions of systems," said the security body.
It's important for organisations to fully migrate over to Python 3 as the way to the two languages are structured could create code incompatibilities in their libraries.
For example, text strings are stored differently in the two languages as Python 2 stores in ASCII which uses 8-bit encoding whereas Python 3's Unicode uses variable bit encoding so it will support most written languages while ASCII won't.
"The impending end-of-life of Python 2 illustrates both the importance of managing a complex software supply chain of third-party components and platforms, as well as the critical need for updates," said Jonathan Knudsen, senior security strategist at Synopsys. "Customers will avoid or ignore updates that are not drop-dead simple, or automatic, which can result in stale deployments that are plagued by bugs that have already been fixed."
Python 3 is essentially a more intelligent language that comes bundled with lots of new features that makes coding easier and less convoluted. It irons out some annoying features of Python 2 such as integer division which would previously round down to the nearest whole number.
The NCSC recognises that porting all of an organisation's code to a new language can be a daunting task, but there are tools out there to help make it easier.
'Can I Use Python 3' is a program which will scan projects for dependencies that will prevent porting to Python 3, while '2to3' is a tool which will attempt to port Python 2 source code into 3.
The official Python website will also have documentation that organisations will find helpful and links to free resources to help further with the process.
source itpro
Industry: Cyber Security

Latest Jobs
-
- Senior Presales Consultant | Managed Security Services | London
- London
- N/A
-
Senior Presales Consultant – Managed Security Services Location: London-commutable (Hybrid) A well-established cyber consultancy is seeking a Senior Presales Consultant to drive growth across its managed security services / advisory portfolio. This hybrid role bridges commercial and technical expertise supporting solution design, shaping customer proposals, and guiding conversations from scoping through to delivery. Key experience: Background in managed security services, including SOC operations and threat detection Strong knowledge of cloud and on-prem security tooling (SIEM, EDR, IAM) Penetration testing Proven ability to translate technical concepts into clear business value Confident in customer-facing engagements and pre-sales delivery Experience contributing to bids, proposals, and RFI/RFP responses To find out more contact me on 07884666351 Visa sponsorship is unfortunately not available for this role.
-
- New Business | Cyber Security | Overlay sales (UK Based- London commutable)
- London
- N/A
-
New Business Sales Hunter needed | Cybersecurity (UK Based- London commutable) Are you looking for uncapped commission, a fun and sociable team that drives success with no politics? If so...You must Have a demonstrable history of sales success in Cyber Security Follow Weatons law. The role: Seeking a proven New Business Sales Hunter to join an established, successful and expanding team. New business focused - £500-750 GP Sell a blend of security services & professional services. Ideal experience selling some or all of the following Cyber strategy & risk management Managed detection & response (MDR) Penetration testing Compliance & audit support You: Strong cybersecurity/IT services sales track record. Confident selling into mid-market & enterprise. UK based - London commutable Hunter mindset, full sales cycle ownership. Don't just send an email to apply give me a call on 07884666351
-
- New Business Sales Hunter | Cyber Security (UK Based)
- London
- To attract the right person
-
New Business Sales Hunter needed | Cybersecurity (UK Based) Are you looking for uncapped commission, a fun and sociable team that drives success with no politics? If so...You must Be UK based - and able to achieve UK SC clearance. (sorry no visas) Have a demonstrable history of sales success in Cyber Security Follow Weatons law. The role: Seeking a proven New Business Sales Hunter to join an established, successful and expanding cyber security firm. New business focused - £1m GP year one target (ramped). Sell a blend of security services & professional services. Ideal experience selling some or all of the following Cyber strategy & risk management Managed detection & response (MDR) Penetration testing Compliance & audit support You: Strong cybersecurity/IT services sales track record. Confident selling into mid-market & enterprise. UK based - London commutable 1x per week. Hunter mindset, full sales cycle ownership. Don't just send an email to apply give me a call on 07884666351