Shrift is an ancient word and comes from the act of shriving, which is the confessional process conducted by a priest.
In his pursuit of forgiveness, a confessor seeks absolution for the sins of his soul through a process of penance administered by the priest.
A short shrift refers to the brief time allowed with a priest to a condemned convict just before his execution.
When someone receives an unfair judgment we say they’ve been given a “short shrift”.