This sounds like a particular scene from the movie Colombiana, a rather "modern" (2011) movie starring Zoe Saldana:
A young woman grows up to be a stone-cold assassin after witnessing
her parents' murder as a child in Bogota. She works for her uncle as a
hitman by day, but her personal time is spent engaging in vigilante
murders that she hopes will lead her to her ultimate target - the
mobster responsible for her parents' death.
And Wikipedia even lists your description as part of the plot summary:
She is assigned to kill the notorious gangster Genarro Rizzo (Affif
Ben Badra), who is currently in police custody. Implementing an
elaborate plan, she gets herself arrested while dressed in a disguise.
She manages to escape her cell with tools she hid in her disguise,
travel through the ventilation system, successfully kill Rizzo, and
return to her cell. The next morning she is released.
I think this particular plot section was also featured rather prominently in the movie's trailer.