It's early days but he hopes this could eventually help him establish an "objective biological measure" for psychiatric conditions.
In theory, people with mental health symptoms could have their levels of cortisol tested, and this could help to inform their diagnosis.
Currently, mental health diagnosis is largely subjective, so this could provide professionals with an additional tool to help make their assessments more accurate.
And a good diagnosis is "the only way to provide the right treatment", said Dr Herane-Vives.
It could potentially be used to inform who might or might not benefit from anti-depressants.
Cortisol can be measured in blood, but this only gives a snapshot of an individual's levels of the hormone in that moment.
And since blood tests themselves can be stressful, this can potentially give false positives.
Dr Herane-Vives wanted to see if a patient's chronic cortisol levels - what they looked like over a longer period of time - could be measured by looking at tissues in the body where it accumulates.
He previously studied whether cortisol could be measured from hair follicles, but to do that you need 3cm of hair - which not everyone has, or wants to lose.
"But cortisol levels in earwax appear to be more stable," he said.
Dr Herane-Vives pointed to analogies with another wax-producing creature: bees. They store sugar in their waxy honeycomb, where it is preserved at room temperature.
So hormones and other substances are stored over time in the earwax, which "yielded more cortisol than hair samples", the researchers said.
Over the longer term, the method could be developed to measure other things like glucose levels or even antibodies against viruses.