I have looked and been unable to find an official Church teaching of what “free from all attachment to sin” means. To me, it means that at that time of the indulgence, I have no desire to sin in any form, in my thoughts or words or actions. It does not mean I will never sin again or that I cannot be forgiven if I do; it refers specifically to the state of my heart, mind and soul at the time I am seeking to earn the indulgence by my actions.
Here is another interpretation from: catholic.org/clife/prayers/indulgc.php
"The greatest hurdle is the last. Making a good confession is not particularly difficult, and going to Communion and praying for the Pope’s intentions are easier still. It’s being free from all attachment to sin that’s hard and it’s quite possible that even evidently good people, who seek plenary indulgences regularly, never, in their whole lives, obtain one, because they are unwilling to relinquish their favorite little sins.
There is an account of St. Philip Neri, who died in 1595, preaching a jubilee indulgence in a crowed church. A revelation was given to him that only two people in the church were actually getting it, an old char-woman and the saint himself. Not exactly encouraging, huh? But don’t worry. If you aren’t perfectly disposed and can’t get the plenary indulgence. you’ll at least come away with a partial."And there is also an article from “This Rock” magazine: catholic.com/thisrock/2006/0609fea3sb.asp
For me, the bottom line is this: No one but almighty God knows the state of my mind, heart and soul. If he grants that I may earn a plenary indulgence so be it. If he grants that it be a partial indulgence, so be it. Even the slightest partial indulgence from God is greater than anything this poor human can obtain on their own.