What is the condition / hook to filter the titles displayed in the sidebar?

Edit: I actually meant posts titles. Like if there's a widget that displays 5 most recent posts, I want to filter the output of those 5 titles.