Microsoft released a free software patch Tuesday to fix a major security flaw in its Windows 10 operating system.

The flaw, which was discovered by the U.S. National Security Agency, could allow hackers to intercept seemingly secure communications.

But rather than exploit the flaw for its own intelligence needs, the NSA tipped off Microsoft so that it can fix the system for everyone.

Microsoft credited the NSA for discovering the flaw. The company said it has not seen any evidence that hackers have used the technique discovered by the NSA.

Microsoft said an attacker could exploit the vulnerability by spoofing a code-signing certificate so it looked like a file came from a trusted source.

"The user would have no way of knowing the file was malicious, because the digital signature would appear to from a trusted provider," the company said.

Could be used to decrypt confidential info

If successfully exploited, an attacker would have been able to conduct "man-in-the-middle" attacks and decrypt confidential information on user connections, the company said.

Some computers will get the fix automatically if they have the automatic-update option turned on. Others can get it manually. Microsoft typically releases security and other updates once a month and waited until Tuesday to disclose the flaw and the NSA's involvement.

Priscilla Moriuchi, who retired from the NSA in 2017 after running its East Asia and Pacific operations, said this is a good example of the "constructive role" that the NSA can play in improving global information security. Moriuchi, now an analyst at the U.S. cybersecurity firm Recorded Future, said it's likely a reflection of changes made in 2017 to how the U.S. determines whether to disclose a major vulnerability or exploit it for intelligence purposes.

The revamping of what's known as the "Vulnerability Equities Process" put more emphasis on disclosing unpatched vulnerabilities whenever possible to protect core internet systems and the U.S. economy and general public.

Those changes happened after a group calling itself "Shadow Brokers" released a trove of high-level hacking tools stolen from the NSA.