Woman 'attacked by man sitting in her car'

A Sydney woman has allegedly been assaulted by a man she found sitting in her car late at night.

Another man was also allegedly attacked after stepping in to help the woman in the eastern suburb of Matraville about 1am on Friday morning.

People nearby carried out a citizen's arrest on the alleged attacker, a 44-year-old who police say tried to flee before officers arrived and arrested him.

The 19-year-old woman had returned to her vehicle after a work shift when she discovered the man, whom she and members of the public asked to get out.

The man then allegedly assaulted the woman, leaving her with minor facial injuries before attacking another man who came to her aid.

The second alleged attack victim was treated by NSW Ambulance paramedics for head injuries and taken to Prince of Wales Hospital in a stable condition.

Police took the suspect to hospital and then to Maroubra Police Station, where he was charged with entering a vehicle without consent, two counts of common assault, reckless wounding and using an offensive weapon with intent to commit an indictable offence.

The man faced Waverley Local Court on Friday and was refused bail.