Galatians 6:14: "But far be it from me to boast except in the cross of our Lord Jesus Christ, by which the world has been crucified to me, and I to the world."
Philippians 3:8: "Indeed, I count everything as loss because of the surpassing worth of knowing Christ Jesus my Lord. For his sake I have suffered the loss of all things and count them as rubbish, in order that I may gain Christ..."
+++
The text is public domain:
When I survey the wondrous cross
On which the Prince of Glory died,
My richest gain I count but loss
And pour contempt on all my pride.
Forbid it, Lord, that I should boast
Save in the death of Christ, my God;
All the vain things that charm me most,
I sacrifice them to His blood.
See, from His head, His hands, His feet
Sorrow and love flow mingled down!
Did e'er such love and sorrow meet
Or thorns compose so rich a crown?
Were the whole realm of nature mine,
That were a tribute far too small;
Love so amazing, so divine,
Demands my soul, my life, my all!
+++
The Biblical sources for this hymn are clear-cut. Philippians 3:8, specifically "I count everything as loss," is in the first verse, rendered as "My richest gain I count but loss."
The first part of Galatians 6:14 is paraphrased in the first two lines of the hymn's second verse: "Forbid it, Lord, that I should boast / Save in the death of Christ, my God."