diff --git a/core/modules/media/src/Plugin/media/Source/OEmbed.php b/core/modules/media/src/Plugin/media/Source/OEmbed.php
index 9fbea0b16c..ba7e691bdf 100644
--- a/core/modules/media/src/Plugin/media/Source/OEmbed.php
+++ b/core/modules/media/src/Plugin/media/Source/OEmbed.php
@@ -26,6 +26,7 @@
 use GuzzleHttp\Exception\RequestException;
 use Psr\Log\LoggerInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
+use Symfony\Component\HttpFoundation\File\MimeType\ExtensionGuesser;
 
 /**
  * Provides a media source plugin for oEmbed resources.
@@ -392,7 +393,8 @@ protected function getLocalThumbnailUri(Resource $resource) {
     // Compute the local thumbnail URI, regardless of whether or not it exists.
     $configuration = $this->getConfiguration();
     $directory = $configuration['thumbnails_directory'];
-    $local_thumbnail_uri = "$directory/" . Crypt::hashBase64($remote_thumbnail_url) . '.' . pathinfo($remote_thumbnail_url, PATHINFO_EXTENSION);
+    $path_extension = pathinfo($remote_thumbnail_url, PATHINFO_EXTENSION) ? '.' . pathinfo($remote_thumbnail_url, PATHINFO_EXTENSION) : '';
+    $local_thumbnail_uri = "$directory/" . Crypt::hashBase64($remote_thumbnail_url) . $path_extension;
 
     // If the local thumbnail already exists, return its URI.
     if (file_exists($local_thumbnail_uri)) {
@@ -412,6 +414,15 @@ protected function getLocalThumbnailUri(Resource $resource) {
     try {
       $response = $this->httpClient->get($remote_thumbnail_url);
       if ($response->getStatusCode() === 200) {
+        // The $remote_thumbnail_url does not contain a file extension, so 
+        // try to guess the file extension from the responses' Content-Type
+        // header. 
+        if (!$path_extension && $response->hasHeader('Content-Type')) {
+          $guesser = ExtensionGuesser::getInstance();
+          $path_extension = $guesser
+            ->guess($response->getHeader('Content-Type')[0]);
+          $local_thumbnail_uri = "$directory/" . Crypt::hashBase64($remote_thumbnail_url) . '.' . $path_extension;
+        }
         $this->fileSystem->saveData((string) $response->getBody(), $local_thumbnail_uri, FileSystemInterface::EXISTS_REPLACE);
         return $local_thumbnail_uri;
       }
diff --git a/core/modules/media/tests/fixtures/oembed/druplicon b/core/modules/media/tests/fixtures/oembed/druplicon
new file mode 100644
index 0000000000..3b49a4ce78
Binary files /dev/null and b/core/modules/media/tests/fixtures/oembed/druplicon differ
diff --git a/core/modules/media/tests/fixtures/oembed/video_vimeo-no-extension.json b/core/modules/media/tests/fixtures/oembed/video_vimeo-no-extension.json
new file mode 100644
index 0000000000..20c0339115
--- /dev/null
+++ b/core/modules/media/tests/fixtures/oembed/video_vimeo-no-extension.json
@@ -0,0 +1,16 @@
+{
+  "type": "video",
+  "version": "1.0",
+  "provider_name": "Vimeo",
+  "provider_url": "https:\/\/vimeo.com\/",
+  "title": "",
+  "author_name": "Tendenci - The Open Source AMS",
+  "author_url": "https:\/\/vimeo.com\/schipul",
+  "html": "<iframe width=\"480\">By the power of Greyskull, Vimeo works!</iframe>",
+  "width": 480,
+  "height": 360,
+  "description": "Special thanks to Tendenci, formerly Schipul for sponsoring this video with training, equipment and time. The open source way. All creative however was self directed by the individuals - A. Hughes (www.schipul.com\/ahughes) featuring QCait (www.schipul.com\/qcait) - Hands On Drupal\n\nDrupal is a free software package that allows an individual or a community of users to easily publish, manage and organize a wide variety of content on a website.\n\nNeed a little Drupal help or just want to geek out with us?  Visit our www.schipul.com\/drupal for more info - we'd love to connect!\n\nGo here for Drupal Common Terms and Suggested Modules : http:\/\/schipul.com\/en\/helpfiles\/v\/229",
+  "thumbnail_url": "internal:\/core\/modules\/media\/tests\/fixtures\/oembed\/druplicon",
+  "thumbnail_width": 295,
+  "thumbnail_height": 221
+}
diff --git a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php
index 4237271366..d86b36b31e 100644
--- a/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php
+++ b/core/modules/media/tests/src/FunctionalJavascript/MediaSourceOEmbedVideoTest.php
@@ -164,6 +164,23 @@ public function testMediaOEmbedVideoSource() {
 
     $assert_session->pageTextContains('The CollegeHumor provider is not allowed.');
 
+    // Register a second oembed resource with a thumbnail without an extension.
+    $video_url = 'https://vimeo.com/7073898';
+    ResourceController::setResourceUrl($video_url, $this->getFixturesDirectory() . '/video_vimeo-no-extension.json');
+
+    // Create a new media item.
+    $this->drupalGet("media/add/$media_type_id");
+    $assert_session->fieldExists('Remote video URL')->setValue($video_url);
+    $assert_session->buttonExists('Save')->press();
+
+    /** @var \Drupal\media\MediaInterface $media */
+    $media = Media::load(2);
+    // The thumbnail should have been downloaded.
+    $thumbnail = $media->getSource()->getMetadata($media, 'thumbnail_uri');
+    $this->assertFileExists($thumbnail);
+    // The thumbnail uses the correct extension.
+    $this->assertEqual(pathinfo($thumbnail, PATHINFO_EXTENSION), 'png');
+
     // Test anonymous access to media via iframe.
     $this->drupalLogout();
 
