David Henry Barnett, a CIA officer who worked undercover as a U.S. diplomat in the Indonesian seaport of Surabaya in the late 1960s, was indicted yesterday on charges that he sold the Soviet Union details of how the CIA had obtained Russian weapons and instruments from the Indonesians.

The indictment, handed down by a federal grand jury in Baltimore, gave no details of how much money Barnett allegedly received from the Soviets or what he is supposed to have told them. It simply said that Barnett supplied the Soviets with details of a CIA operation code-named HABRINK, which the Justice Department said involved "covert collection by the CIA of Soviet manuals, weapons, instruments and parts."

Sources said the CIA was collecting missiles and radar that had been turned over to the Indonesian Navy by the Soviet Union. While the indictment did not mention it, sources said Barnett was deeply involved in HABRINK from August 1967 until late 1969, while he served in Surabaya.

Under President Sukarno, Indonesia was firmly in the Soviet camp in the 1960s and was given billions of dollars' worth of Soviet military equipment, especially naval equipment. Moscow trusted Indonesia and Sukarno so deeply that it even gave them submarines, surface warships and ship-to-air missiles.

Presumably, the Soviets had no idea their weapons were being resold to the CIA by Indonesian naval officers until Barnett allegedly told them. The indictment said Barnett said that he gave the Russians the HABRINK information between Oct. 31, 1976, and Feb. 27, 1977, in Vienna and Jakarta. Barnett was no longer working for the CIA at the time.

Besides the details of HABRINK, Barnett was said also to have given the Soviets a "damage report," meaning he told them how much the United States was helped by obtaining the Soviet weapons from the Indonesians.

"This would be an unusually good piece of intelligence for the Russians," one source said. "It would help them to know that the United States had their hands on Russian missiles and radar but it would help them even more to know how much use we were making of those things."

Sources said that HABRINK was one of the most successful undercover CIA operations ever undertaken against the Soviet Union. One source said that the Indonesians furnished samples of almost every piece of Soviet naval hardware except an entire submarine.

"We were getting everything they had," this source said. "We were wheeling the nose cones from heat-seeking missiles down the hall in shopping carts."

While the indictment did not mention it, Barnett is also said to have been paid by the Russians after he left the CIA to try to gain a staff job on either the Senate or House Intelligence committees in hopes that he could become a Soviet mole on Capitol Hill.

Sources on the Senate Intelligence Committee said Barnett came seeking a position in 1977 but was turned down. The House Intelligence Committee also rejected his application, which came with an accompanying introduction from Rep. Andrew Maguire (D-N.J.), who knew Barnett through Barnett's wife.

"I referred him routinely to the appropriate committee staff with the advice that since I knew nothing specific about his intelligence work they should check him out with their intelligence sources," Maguire said yesterday in a prepared statement. "The two Intelligence committees and the FBI are to be commended on their investigation of the whole matter."

The Justice Department gave no details of how it caught on to Barnett's alleged dealings with the Soviets, but one source suggested the CIA might have been tipped off by a Soviet defector.

Capitol Hill sources said that Barnett received from $80,000 to $120,000 from the Soviets for the information he supplied. Friends said that Barnett was strapped for money ever since he left the CIA in 1970.

Barnett taught at a private school in Pennsylvania, but left because of disappointment in his career there. He went back to Indonesia, where he managed a shrimp factory before starting an import business dealing in Indonesian furniture. Barnett apparently lost money in the venture, which failed in 1975, Barnett was even more strapped for cash when his wife was stricken with a blood clot of the brain.

The indictment carries a maximum penalty of life imprisonment if convicted. Sources said that Barnett, who is 47, plans to plead guilty or no contest as part of a plea-bargaining move.