Yes this should be corrected and it would be good to have the wiring and all the circuit connections inspected as well.
Disturb attic insulation to run wire.
The attic wiring should be protected and secured to ceiling joists or other wood structural supports.
The following links will assist you with your electrical question.
If there is access above the light in an attic or kneewall space you can remove the wire from the existing fixture box and install it in a junction box.
An attic that is accessible which is defined by the nec as having a permanently installed stair or ladder in place must have protection for any cables that run across the top of the attic floor joists or within 7 feet where they run across the face of rafters or studs.
Climb through the attic access using a ladder if necessary and look into the attic space.
A pull down attic ladder does not count.
With a flashlight examine the attic and locate the path that you will use to run the wire between the two locations.
Whenever i do attic wiring i remove the insulation and staple it to the ceiling joist.
Trace the outline of the box onto the wall.
Familiarize yourself with the footing situation.
If this meets code then i will be running attic wiring in this manner from now on.
You can then splice on a new piece of wire make sure it is the same wire gauge and run the new piece from the junction box back to the fixture box.