A report prepared for the United Nations Commission on Human Rights has accused the Soviet Union of massacring civilians and executing guerrillas in Afghanistan.

The report, unusually forthright for a body which has until now steered clear of major controversy on the question of the Soviet invasion of Afghanistan, was prepared by Felix Ermacora, an Austrian official assigned by the commission to report on the human rights situation there. Richard C. Schifter, U.S. representative on the commission, called it a "full and fair report."

The report does not specifically accuse "Soviet" troops of bombing villages, massacring villagers and summarily executing guerrillas -- it refers to "foreign" troops instead. It will be debated by the commission, currently conducting its annual review of human rights, next week.

In a separate action on Tuesday, the commission voted 31 to 7, with five abstentions, to call for a withdrawal of the "foreign" troops from Afghanistan. At previous sessions the commission had adopted similar resolutions, over Soviet objections.

"This is the first time such a thoroughly documented case has been prepared, which shows us exactly what is going on," Schifter said. "It is all the more important because the Soviets have adopted a deliberate policy of keeping the media out of Afghanistan, threatening their lives if necessary. Thus it's been extremely difficult to know what's happening. And the media focus on this report is going to make it possible for people everywhere to get a true view of the situation."

Ermacora, a law professor who has participated in U.N. human rights investigations of Chile and South Africa, conducted his work without the aid of the Afghan government, which refused to cooperate with him or let him into the country. Afghanistan denounced the decision to appoint him as "unlawful, null and void, politically injurious and morally hypocritical."

The report was commissioned, again over Soviet objections, at last year's session of the commission. Ermacora traveled to Pakistan and conducted in-depth interviews with refugees there. His report, according to U.N. sources, quoted refugees from 15 regions of Afghanistan as saying that as many as 500 persons at a time were massacred by the "foreign" troops, in some cases by pouring an inflammable liquid into tunnels where guerrillas were hiding and setting it on fire.

In one case, in September 1982, Ermacora said he was told, more than 100 persons seeking shelter in an irrigation canal near the village of Padkhwab-e-Sana were killed when soldiers poured the liquid into the canal and set it on fire.

Ermacora reported that one one day in October 1983, "360 persons are said to have been executed" in three villages.

In March 1984, he said, "hundreds of civilians" were killed in the village of Zirvq after 15 days of bombing.

Ermacora also said he had been told of wells being poisoned, and of systematic bombing of villages in a way which effectively destroyed their food supplies and irrigation systems.

He criticized the Afghan government by name -- another radical departure from previous U.N. practice -- and said its system of government is unrepresentative. The Afghan government, he said, should commit itself to a policy ofneutrality and make a start in that direction by convening a constituent assembly which genuinely represents the rights of the Afghan people.

Commenting on the report, Schifter said it went "far, far beyond" the previous Human Rights Commission documents. Moreover, he said, suppression of the report is not possible because although it will be debated when the commission takes up Afghanistan next week, "the report stands on its own."

"What we are trying to achieve is to have a resolution put to the commission which will embody a lot of what is in that report, and have that approved when the session winds up March 11," he said. Such a resolution, he said, would have to be sponsored by what he termed "a broad-based coalition" of countries, including not only the United States and other western nations but also Third World representatives.

"We're getting some results on putting that coalition together," Schifter said. He said some Third World delegates had said they were "shocked" by the report.

The references to torture by "foreign" troops in the report will be particularly damaging to Afghanistan, U.N. sources predicted, because that country only last month signed a new U.N. convention banning torture.