The federal government has discovered a loophole in the former Labor government's offshore processing legislation and wants to urgently pass a bill to amend the law by the end of the week because it fears a High Court challenge.

The loophole relates to a landmark ruling the High Court made in the Williams case regarding the school chaplains program in which the court defined how the Commonwealth could fund services.

The Nauru detention centre, as pictured in 2012. Credit:Angela Wylie

Fairfax Media understands that Labor has resolved to support the government amendment to close the loophole after calling a special caucus meeting on Wednesday to discuss the bill.

The government wants the legislation passed before Parliament rises on Thursday for the six-week winter break.