The author of a United Nations report critical of alleged Soviet atrocities in Afghanistan said today he had been accused of "having my report written by the CIA" in debate in the U.N. Human Rights Commission.

Felix Ermacora, an Austrian law professor, said that in the more than 20 years he has been associated with the panel "I have never come across such vilification . . . .

"When I prepared reports on human rights violations in Chile and South Africa, I was applauded," he told a press conference. "Now, suddenly, I am told that my report on Afghanistan has been written by the CIA."

Ermacora's report was prepared for the commission over Soviet objections and without the consent of the Afghan government, which refused to allow him into that country. It accuses the Soviet Union of massacring civilians, executing guerrillas and, in some cases, using poison gases against them.

Ermacora stood by his report today. "Every word in it is true," he said. "There are no opinions expressed here, just straight reporting of facts. And to anyone who says I am falsifying the record I reply: if 4 million people leave their country Afghanistan , then there must be a good reason."

Ermacora said the decision to identify the Soviet troops as "foreign" in his report had been his alone. Nobody pressured him to take out the word "Soviet," he said.

The human rights commission is currently debating Afghanistan among other issues, but the report stands by itself and cannot be changed during the debate. The United States, which has characterized the report as "full and fair," is currently working on the drafting of a resolution in the commission that would condemn Soviet tactics in Afghanistan on the basis of the Ermacora report.

But U.S. sources said the resolution was being soft-pedaled so as not to disturb the resumption of the Soviet-American arms talks here Tuesday. The human rights meeting lasts through March 20.

At his press conference Ermacora repeated the allegations made in his report that the Soviets have used poison gases against Afghan guerillas. But under repeated questioning from western reporters he declined to say specifically that the Soviets have been engaging in chemical warfare.

"Chemical warfare means different things to different people, and perhaps it is not applicable to use that phrase here," he said.

The accusations of the report being a CIA fake were made during debate in the human rights panel, he said, and in conversations. "I can assure you that I never consulted anyone in compiling my report except U.N. officials and the refugees themselves," he said.