A blunder by Accrington goalkeeper Ian Dunbavin handed the points to Hereford in a closely-fought battle at Edgar Street.
The former Shrewsbury stopper allowed a shot from Hereford's Alan Connell to spin out of his hands and into the corner of the net to gift the victory to the Bulls, extending United's unbeaten home run to five matches.
Hereford included on-loan signing Neil MacKenzie, who has arrived from Scunthorpe for a month, while the visitors gave a first start of the season to former Bulls favourite David Brown.
Brown had an early opening when his namesake, Wayne, in the Hereford goal, miss-kicked his clearance but the former Manchester United trainee drove his shot wide from 35 yards.
The two goalkeepers had relatively little to keep them occupied in a first-half which was largely confined to midfield.
Hereford's Andy Williams headed wide following a John Eustace free-kick and Connell saw a 20-yarder well saved by Dunbavin.
Eustace and MacKenzie then got a grip on midfield for a short spell and Hereford produced some attractive football, although there was little in the way of end product.
From the best of the openings, Connell volleyed narrowly wide after a Williams shot had been deflected by a defender.
Towards the interval, Accrington enjoyed a period of dominance and, on 35 minutes, Sean Doherty went racing past Tamika Mkandawire but saw his well-hit low drive well saved by Wayne Brown.
Within 30 seconds of the re-start, Stanley wasted a great chance to take the lead.
Andy Todd's fine run down the left ended with a drag back to David Brown whose poorly-hit shot was parried away by Wayne Brown.
There were few other chances at either end with the best falling to Hereford's Williams who saw a well-struck 15-yard effort pushed away for a corner by Dunbavin.
After Hereford had taken the lead through Connell's fortuitous strike, it was left to Wayne Brown to preserve the points in injury time. The keeper dived bravely at the feet of Ian Craney to grab the ball as the midfielder raced in on goal.