The OpenSSL project has warned of a security bug that could allow attacks on secured servers.

OpenSSL is an open-source, multi-platform implementation of the SSL and TLS cryptographic protocols, which are used by commercial websites for secure credit-card transactions, among other uses.

The flaw means that an attacker could trick a server into using older, insecure versions of SSL, the project said. Some sites allow older versions of SSL to be used, but only under particular conditions, such as if a client can't support the more secure SSL 3.0 and TLS 1.0.

"An attacker acting as a 'man in the middle' can force a client and a server to negotiate the SSL 2.0 protocol even if these parties both support SSL 3.0 or TLS 1.0," the project said in an advisory on Tuesday. "The SSL 2.0 protocol is known to have severe cryptographic weaknesses and is supported as a fallback only."

Researcher Yutaka Oiwa of the Research Centre for Information Security at Japan's National Institute of Advanced Industrial Science and Technology (AIST) first alerted OpenSSL of the problem. The bug is in an option called SSL_OP_MSIE_SSLV2_RSA_PADDING, intended to help work around interoperability problems. However, the option also disables a verification step needed to prevent active protocol-version rollback attacks, the advisory said.

The bug affects all versions of OpenSSL up to 0.9.7h and 0.9.8a, and is likely to affect any applications using OpenSSL's SSL/TLS implementation, the group said. Versions 0.9.8a and 0.9.7h have been released to fix the problem, with upgrades available via a number of mirror sites.

Users can also apply a patch, available here, or disable SSL 2.0 entirely.