WOLFSBURG, West Germany (AP) _ A West German computer hacker suspected of providing the Soviet KGB with code words to gain access to Western research and defense computers apparently has committed suicide, police said today.

The body of a man found burned to death Thursday near the city of Gifhorn, about 25 miles east of Hanover, has been identified as that of Karl Koch, police said. Koch, 24, was under investigation for his part in a computer scandal that resulted in international headlines in March.

Wolfsburg police said in a statement that Koch apparently doused himself with gasoline and set himself on fire.

A melted plastic gasoline canister was found near the body, ''and there were no signs of foul play from an outside source,'' the statement said.

Koch was one of eight West German computer hackers under investigation for allegedly supplying Soviet agents with code words to gain access to Western computers. Those computers included the U.S. Defense Department's general databank, known as Optimus, and a NASA ''Star Wars'' research computer.

Authorities said at the time that the hackers were believed to have been recruited by the KGB, the Soviet intelligence agency, in 1985 and ''were paid in cash and drugs'' to provide the code words.

Hans-Juergen Foerster, spokesman for the federal prosecutor's office in Karlsruhe, confirmed today that Koch was one of the hackers under investigation.

''We are still investigating the others and expect to file charges when the probe is completed,'' Foerster said.

Officials have said that while the code words allegedly provided by the hackers gave the Soviets access to various computer networks, they were not sufficient to gain access to classified information.