What can survive a secure erase and reinstall? Something did ... how is that possible?

I have encountered something completely puzzling to me.


I recently purchased a used iMac from a reputable vendor who did a fresh install of Catalina. They must have used or tested the unit on their own WIFI network before shipping, because it appeared in the list of WIFI networks in System Preferences > Network > WIFI > Advanced > WIFI Preferred Networks. I deleted the network from the list of Preferred Networks and then clicked Apply. The network was gone and should have been gone for good at that point.


After that, as part of my overall process of setting up a newly-acquired used Mac, I booted into Recovery Mode and did a 2-pass secure erase of the entire HDD and then reinstalled Catalina. The erase and reinstall were both successful.


After the installation finished and I got through all the initial Apple setup screens, I went back to System Preferences to check various settings ... and in WIFI Preferred Networks, the vendor's WIFI network showed up again!


How could this be? I deleted the network from Preferred Networks ... and then did a 2-pass secure erase of the entire disk and reinstalled Catalina. How could this entry in Preferred Networks survive all that?


I can delete the network entry again ... but how is it even possible that it survived a secure wipe & reinstall? ... and it raises the question of what else could be lurking in a way that could survive a wipe & reinstall?


ps. If it's helpful to know, it's a 27" iMac 17,1 MK462LL/A with an HDD - no SSD or Fusion drive.

iMac Line (2012 and Later)

Posted on Apr 21, 2020 9:22 AM

Reply
Question marked as Top-ranking reply

Posted on Apr 21, 2020 9:44 AM

How exactly did you perform the re-install? If you used the recovery partition, it is very likely the vendor has an image that already has their Wifi network setup so they don't have to do it everytime they set up a machine for resale.


If that is the case, the recovery partition would use that image to restore the computer and would have the wifi network setup.


If you boot into Internet recovery, and install a clean version of macOS from the internet, that Wifi network should not appear.


About macOS Recovery - Apple Support

Similar questions

19 replies
Question marked as Top-ranking reply

Apr 21, 2020 9:44 AM in response to MartinR

How exactly did you perform the re-install? If you used the recovery partition, it is very likely the vendor has an image that already has their Wifi network setup so they don't have to do it everytime they set up a machine for resale.


If that is the case, the recovery partition would use that image to restore the computer and would have the wifi network setup.


If you boot into Internet recovery, and install a clean version of macOS from the internet, that Wifi network should not appear.


About macOS Recovery - Apple Support

Apr 24, 2020 12:12 PM in response to etresoft

I bow down to you! The NVRAM turned out to be the problem.


I did an nvram -xp to list the contents and there was quite bit there, although nothing I could specifically ID as a preferred network. Then I deleted the vendor's network from System Preferences > Network ... Preferred Networks and then cleared the NVRAM - there was a lot less in it afterwards. For completeness I also ran an EFI integrity check, which was clear, then I did a final 2-pass erase of the HDD and reinstalled Catalina via Internet Recovery. The vendor's network is gone and all looks clean.


Many, many thanks for your clue about the NVRAM!

Apr 21, 2020 7:40 PM in response to MartinR

MartinR wrote:

I just want to have confidence that the Macs I just bought aren't carrying some hidden malicious crap ... hence the secure erases and the worry about something that keeps appearing despite the erases.

I don't think you have anything to worry about.


I don't know the details of these hidden nvram setting. But it seems plausible that there might be some situation where, during an installation, a machine lost the network, got rebooted, had a firmware update, or something like that where it would sure be handy to automatically reconnect to the previous network. And then, somebody thought it would be a good idea to import that nvram setting into system preferences.


If this network still appears after a fresh install, you could zap the nvram and see if that finally makes it go away. If so, then you will have proven this hypothesis.

Apr 21, 2020 2:50 PM in response to Tesserax

I decided to try Internet Recovery as Phil0124 suggested. It's running now and I'll report back on how it turns out. I'm just setting up the iMac, so there's no data to worry about backing up.


Here's what I'm doing:

Boot into Internet Recovery

  • In Disk Utility,
    • Remove the HFS+ partition I created earlier; resize the APFS container to the entire HDD
    • Do a 2-pass secure erase of the topmost level of the HDD with the options name=iMac HD, format=APFS, scheme=GUID
  • Reinstall Catalina

Restart from the HDD


If the vendor's WIFI network no longer shows up in Preferred Networks, I'll consider it a successful wipe & reinstall.


Apr 21, 2020 6:11 PM in response to etresoft

Well, that's certainly interesting. So, do you think this is just a setting being held in NVRAM and not something injected into the macOS Base Image? And how or why would a WIFI network what was joined at some point get stored in NVRAM in the first place? Does this hint that any network ever joined remains stored in NVRAM? Do you think clearing NVRAM might make it disappear?


I would have thought that information about networks joined would be stored in a user or system file of some sort .... and that if one deleted a joined network from the Preferred Networks list that it would be deleted from such file; and if you erased the disk on which such a file existed it would be permanently gone.


(Sorry for all the questions, stuff like this makes me want to put on a tin foil hat. I just want to have confidence that the Macs I just bought aren't carrying some hidden malicious crap ... hence the secure erases and the worry about something that keeps appearing despite the erases.)

Apr 21, 2020 10:24 AM in response to MartinR

OK, so in Disk Utility itself (not the terminal command diskutil list) I can see an Apple disk image / macOS Base System. I assume that's the installer image that Phil0124 referred to.


Where does this reside? And why doesn't it show up in diskutil list? If this is writeable it would seem anyone creating such an install image could play around with the system outside many security controls.


Apr 21, 2020 5:33 PM in response to Phil0124

It appears the command is hdiutil, not hdutil. Regardless, all hdiutil info shows is the version of the framework & driver (559.100.2) and I suspect that's for the Apple HDD, not the Apple disk image/macOS Base System (which is probably only mounted & available in Recovery mode - it doesn't even show as an unmounted drive in Disk Utility under Catalina).


When you said "trash all the volumes, partitions and disks" did you mean I should also trash the Apple disk image/macOS Base System? I can't tell where it resides, although I'm guessing it's either in the Mac firmware or some nonvolatile memory. If it's possible to trash it, will a reinstall of macOS/Catalina (via Internet Recovery) rebuild it from scratch?

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

What can survive a secure erase and reinstall? Something did ... how is that possible?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.