Uber Technologies Inc. wants to make self-driving cars and naturally, it doesn’t want people to hack them.

The ride-hailing company confirmed on Friday that it had hired two well-known car hackers to help devise its own defenses. Security researchers Charlie Miller and Chris Valasek will work for the Uber Advanced Technologies Center in Pittsburgh.

The...