After treating the subject like forbidden fruit for five months, presidential candidate Edward M. Kennedy seems to be moving toward open criticism of the Carter administration's handling of the hostage crisis in Iran.

Nuance by nuance, Kennedy has been hinting in the week since the failed rescue attempt that he has doubts about the wisdom of that mission and other aspects of President Carter's policy on Iran -- and he thinks a lot of Democrats share his concern.

As a result, Kennedy is now saying that foreign policy should be as important a consideration as domestic problems when Democrats vote in the remaining primary elections. Until the past week, Kennedy had played down foreign policy in his campaign speeches and insisted that the domestic economy should be the chief issue in the primaries.

At the same time, campaign aides say, Kennedy is aware that criticism of Carter's Iran policy right now -- when there seems to be a renewed sense of solidarity behind the president -- could boomerang on the challenger.

The situation is reminiscent of the first weeks of the Kennedy campaign last November, when the candidate clearly felt frustrated about the then-recent seizure of the U.S. embassy in Tehran and was unsure how to deal with it on the campaign trail.

Kennedy's frustration then spilled over in a late-night interview in San Francisco. Answering questions about Iran at the end of a 14-hour campaign day, Kennedy blasted the deposed shah of Iran, saying the former ruler had a "violent" regime and had "stolen . . . umpteen billions of dollars" from the Iranian people.

Those comments prompted some editorial writers and politicians to criticize the Massachusetts Democrat for bad judgment at a delicate time.

After that, the senator stopped talking about the shah, except for a brief period following his Georgetown University speech in late January, essentially dropped foreign policy as an issue in his campaign speeches. "The issues for the nomination are going to be economic," he said at a luncheon at The Washington Post last month. "Quite frankly, I'm trying to focus the campaign on that."

This week, though, the focus began to change. "I think the people are going to make some judgments on foreign policy," Kennedy said at a campaign stop in Houston. "And they're going to consider whether we have a competent foreign policy."

This new tone seems to be a direct result of the unsuccessful rescue mission. Although Kennedy has had nothing but praise for the men who carried it out, he has hinted several times at serious doubts about the commander-in-chief who ordered it.

"The whole issue about the propriety of the mission . . . . is something that will be investigated by the Foreign Relations Committee," the senator said in Houston. "And I think the number one real issue here is the issue of competency . . ."

Kennedy expressed similar doubts Monday when he called a press conference to respond to the news of Cyrus Vance's resignation as secretary of state. Instead of restricting himself as most public people did, to praise for Vance, Kennedy added this thought: "Obviously he knows far more about the failed military effort in Iran and its possible consequences than the rest of us . . . this makes the Foreign Relations Committee investigation even more urgent."

And when Carter announced Wednesday that he would leave the Rose Garden to campaign -- an announcement that prompted Kennedy to challenge the president to a debate -- Kennedy made it clear that he would like to make the Iranian crisis one of the issues to be debated.

"We've had this unsuccessful rescue mission," Kennedy said, "I mean, we've had a secretary of state that resigned, the first time that's happened in 65 years on a matter of policy. I think it's appropriate to debate foreign policy."