Well I assume I have a disc issue.
If the injury is as serious as you make it sound, stop assuming and go see a doctor.
I think it's just too risky to go back to heavy lifting when it gets better.
That depends on the kind of injury you have, so again, the best thing to do is to get it properly diagnosed by a doctor. If you ever do go back to squatting & deadlifting, you may want to fix your technique - read the various tutorials in books and online, watch instructional videos and post some form check videos here.
Those are my two main mass-building moves though. I wonder if I can substitute something like walking lunges or if I'm just screwed.
I'm sorry, but I have to again say that getting a proper diagnosis should be your first task. if I was in your position, my priorities would be:
1. Figure out what my injury is and how severe it is - maybe
any weight training is out of the question in the future, maybe you'll be fine in a few months to do anything you want, or anything in between.
2. Find out what you need to do to heal and rehab it and do that before you start weight training again
The squat and deadlift are awesome at building mass precisely because they use the vast majority of the muscles in your body, including your back. Any alternatives will probably be somewhat less effective, but you aren't totally screwed. It's unclear which of these your back will tolerate, but here are some options:
Front squats
Overhead squats
Cleans (or power cleans if you can't front squat)
Snatches (or power snatches if you can't overhead squat)
Weighted lunges
Weighted step-ups
And, of course, any heavy, compound upper body exercises you can handle (bench press, OH press, weighted pull-ups, etc) will help as well.