## Summary by the researcher
███████████████████████████
███████▀▀▀░░░░░░░▀▀▀███████
████▀░░░░░░░░░░░░░░░░░▀████
███│░░░░░░░░░░░░░░░░░░░│███
██▌│░░░░░░░░░░░░░░░░░░░│▐██
██░└┐░░░░░░░░░░░░░░░░░┌┘░██
██░░└┐░░░░░░░░░░░░░░░┌┘░░██
██░░┌┘▄▄▄▄▄░░░░░▄▄▄▄▄└┐░░██
██▌░│██████▌░░░▐██████│░▐██
███░│▐███▀▀░░▄░░▀▀███▌│░███
██▀─┘░░░░░░░▐█▌░░░░░░░└─▀██
██▄░░░▄▄▄▓░░▀█▀░░▓▄▄▄░░░▄██
████▄─┘██▌░░░░░░░▐██└─▄████
█████░░▐█─┬┬┬┬┬┬┬─█▌░░█████
████▌░░░▀┬┼┼┼┼┼┼┼┬▀░░░▐████
█████▄░░░└┴┴┴┴┴┴┴┘░░░▄█████
███████▄░░░░░░░░░░░▄███████
██████████▄▄▄▄▄▄▄██████████
███████████████████████████
## The report
Для начало прошу прощения за столько много выделенны�
ТИПОВ ...
(коротко с помощью уязвимости можно ставить отметку на фото гео лакации любому пользователю)
Следование этому пожеланию увеличит вероятность получения награды.
Сервис, в котором найдена уязвимость.
https:/vk.com/al_places.php
http://vk.com/al_photos.php
+ код Олега у каждого пользователя вк (его альбом)
Тип уязвимости.
Хранение hash в открытом доступе и следовательно
При правильном запросе можно поставить любому пользователю (гео) метку на фотографию
(это уже какой-то �
акинг =) )
Все на�
одится в открытом доступе, как всегда у вас =)
Как можно проэксплуатировать.
Показано на видео прикрепил оригинал видео залил на yandex disk и на youtube ссылки:
https://yadi.sk/i/XnUy08vIh7Ecf
https://youtu.be/SZGu2Nd-QOk
Как повторить.
Выбираете любого пользователя , выбираете любое его фото и копируете часть из ссылки на фото
(например 307707832_367700640)
Далее нам понадобится ссылка для получение hash фотографии пользователя
Для этого нам нужна ссылка https:/vk.com/al_places.php?act=show_photo_place&al=1&edit=1&photo=ХХХХ_ХХ
где �
�
�
�
_�
�
это ссылка на фото в виде ( 307707832_367700640 )
Посылаем запрос (как пример)
https:/vk.com/al_places.php?act=show_photo_place&al=1&edit=1&photo=307707832_367700640
Просматриваем код страницы , на�
одим там hash
Теперь чтобы создать метку у пользователя на фото , нам понадобится ссылка
http://vk.com/al_photos.php?act=do_edit_place&al=1&hash=ТУТХЕШ&lat=0.7031073524364909&long=16.875&photo=ТУТФОТОФОРМАТА�
�
�
_�
�
�
Посылаем запрос (как пример)
http://vk.com/al_photos.php?act=do_edit_place&al=1&hash=0268f5b2baab24d032&lat=0.7031073524364909&long=16.875&photo=307707832_367700640
Нам вернется ошибка , следовательно если пользователь ее откроет которому принадлежит фото , то метка появится ! Отсылаем пользователю ссылку он ее открывает и мы радуемся (грустим конечно)
Чтобы пользователь нечего не спалил можно сделать следующем образом создать страничку с iframe вставить туда эту ссылку и код на перенаправление на вк.ком через 5 секунд к примеру и воуля . Кидаем эту страничку в интернете пользователю он открывает отсылается обратно в вк и нечего не подозревает =))
Да в видео еще показано вначале , если вы не смотрите -
ОЛЕГ И. ЗАБЫЛ СВОЙ АЛЬБОМ У ПОЛЬЗОВАТЕЛЕЙ НА СТРАНИЧКАХ =)
Как исправить, с вашей точки зрения.
Проверку на принадлежит ли фото пользователю введите в метод ( if else )
(да у меня все проблемы так решаются)
The original report as published on HackerOne, by pisarenko. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.
Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 5 min read.
## Context
The target is VK.com, and the feature in question is the geolocation tag on a photo: the ability to attach a place (latitude and longitude) to a picture in a user's album. The report names two endpoints that serve this feature:
```text
https:/vk.com/al_places.php
http://vk.com/al_photos.php
```
The researcher also refers to "the code of Oleg" that every VK user has in their album, without explaining what it is. The weakness is classified as code injection, and the report was disclosed on 7 September 2015 with a bounty of 200.00 USD.
## Setup
No special accounts, roles or tools are described. The only precondition is that the attacker knows the identifier of a target photo, which is visible in the photo's URL. The researcher gives the example `307707832_367700640`, a pair of numbers in the form `owner_photo`.
## Finding it
The researcher states that a hash is stored in the open and that, with the right request, a geolocation mark can be placed on any user's photo. In their words this is already "some kind of hacking". The summary at the top of the report says the same in one line: the vulnerability lets you put a geolocation mark on a photo for any user.
## Exploitation
### Step 1: pick a photo and copy its identifier
Choose any user, choose any of their photos, and copy part of the photo link, for example:
```text
307707832_367700640
```
### Step 2: fetch the page that contains the photo hash
The researcher uses the following URL to obtain the hash of a user's photo:
```text
https:/vk.com/al_places.php?act=show_photo_place&al=1&edit=1&photo=ХХХХ_ХХ
```
Here `ХХХХ_ХХ` is the photo identifier in the form shown above. A concrete request is:
```text
https:/vk.com/al_places.php?act=show_photo_place&al=1&edit=1&photo=307707832_367700640
```
The parameters select the `show_photo_place` action, set `al=1` and `edit=1`, and pass the photo identifier. The researcher then views the page source and finds the hash there.
### Step 3: send the request that creates the place mark
With the hash in hand, the researcher uses this URL to create a mark on the photo:
```text
http://vk.com/al_photos.php?act=do_edit_place&al=1&hash=ТУТХЕШ&lat=0.7031073524364909&long=16.875&photo=ТУТФОТОФОРМАТА�
�
�
_�
�
�
```
The action is `do_edit_place`, `al=1` is kept, `hash` carries the value taken from the previous page, `lat` and `long` carry the coordinates, and `photo` carries the photo identifier. A concrete request is:
```text
http://vk.com/al_photos.php?act=do_edit_place&al=1&hash=0268f5b2baab24d032&lat=0.7031073524364909&long=16.875&photo=307707832_367700640
```
According to the researcher, an error is returned. The mark nevertheless appears if the user who owns the photo opens the link. So the attacker sends the link to the victim, the victim opens it, and the mark is created.
### Step 4: hide the request from the victim
To keep the victim from noticing, the researcher suggests building a page that contains an iframe with the link inside it, plus code that redirects to vk.com after, for example, five seconds. The page is hosted somewhere on the internet and sent to the user; the user opens it, is sent back to VK, and suspects nothing.
The researcher also notes that the video shows, at the beginning, that Oleg forgot his album on users' pages.
{{media:0}}
The video is the demonstration of the whole flow; the researcher uploaded the original to Yandex Disk and YouTube and gives both links.
## Root cause
The hash needed to perform the edit is exposed on a page that can be requested for any photo, so the attacker can obtain it without owning the photo. The researcher's diagnosis is that the ownership check on the photo is missing from the method. The researcher's own diagnosis is that the ownership check on the photo is missing from the method, and their suggested fix is to add it as an `if else` check. The report does not describe any other defence that was present or bypassed.
## Impact
An attacker can place a geolocation mark on any user's photo, provided the attacker knows the photo identifier and the victim opens the crafted link. The mark appears when the owner of the photo opens the link, while the attacker's request returns an error. The report does not describe any further consequence beyond the mark itself.
## Fix
The researcher's recommendation is to add a check that the photo belongs to the user inside the method, expressed as an `if else`.
## Variants to test
1. Request the page that exposes the hash for photos belonging to other accounts and look for a hash in the response. A positive result is a hash that the edit endpoint later accepts.
2. Send the edit request from an account that does not own the photo and observe whether the action is rejected or silently deferred to the owner's session. A positive result is a mark appearing after the owner opens the link.
3. Wrap the edit link in an iframe on a third-party page with a delayed redirect, as the researcher describes, and check whether the mark is created without any visible prompt. A positive result is a mark on the photo with no interaction beyond loading the page.
## Hunting notes
This kind of bug hides in AJAX-style endpoints that return editing material, such as a hash or token, for objects the caller does not own, and in the companion endpoint that consumes that material. During recon, look for `al_*.php` style handlers with `act=` parameters that both read and write object state, and check whether the read side is scoped to the owner. The signal is a read endpoint that happily returns a per-object secret for an arbitrary object identifier taken from a public URL. The researcher demonstrated the chain in a video, from reading the hash to sending the crafted link.
Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 11 min read.
## What happened, in plain words
VK.com lets people attach a place to a photo, so the picture shows where it was taken. That place is stored as two numbers, a latitude and a longitude, and the feature that saves them is what this report is about.
The researcher found that the hash used to authorise that save can be read from a page VK serves openly, using a photo identifier. With that hash in hand, a request can be built that adds a place mark to somebody else's photo. The request only works when the owner of the photo opens it, so the attacker has to get the victim to click a link. The researcher also shows a way to make that click look harmless.
The report was filed on HackerOne against VK.com, disclosed on 7 September 2015, and paid a bounty of 200.00 USD. The weakness is classified as code injection.
## The pieces you need to understand first
Before walking through the steps, here are the ideas the report leans on, explained from scratch.
- **A web page and its source.** When your browser shows a page, it is really reading a text file written in a language called HTML. You can see that text yourself: right-click the page and choose something like "View page source". Anything written in that text, including hidden values, is visible to you and to anyone else who asks for the same page.
- **A URL and its parameters.** A URL is the address of a page. Everything after a `?` is a list of parameters, written as `name=value` pairs joined by `&`. They tell the server what you want: which action to perform, which object to act on, and so on. Think of a restaurant order slip: the dish name and the table number are parameters.
- **An endpoint.** An endpoint is a specific address on a server that does one job. VK has many, and the report names two of them. One hands out information, the other changes something.
- **An API-style handler.** VK's pages with names like `al_places.php` and `al_photos.php` are not ordinary pages you read; they are small programs that take parameters and return data or perform an action. The `act=` parameter picks which action runs. This is the same idea as an API, a way for software to talk to a server by sending requests with parameters.
- **A hash (in this sense).** Here the word does not mean a cryptographic fingerprint. It is a short secret string that the server issues and later checks, to confirm that a request comes from someone who was allowed to make it. It works like a cloakroom ticket: whoever holds the ticket can collect the coat. If the ticket is printed on a public noticeboard, anyone can collect the coat.
- **A session.** When you log in, the server gives your browser a cookie, a small piece of data it sends back with every request so the server knows who you are. Actions you take are performed "in your session", meaning as you.
- **An iframe.** An iframe is a window inside a web page that loads another page. The outer page can be anywhere on the internet; the inner one can be a VK address. Loading the outer page silently loads the inner one too.
- **A redirect.** A redirect is an instruction that sends the browser to a different address automatically, often after a delay. It is how a page can show you one thing and then quietly move you somewhere else.
- **Code injection (the classification).** Broadly, this label covers cases where input the attacker controls is accepted and acted on by the server as if it were a legitimate instruction. Here the crafted request is accepted and changes data it should not be allowed to change.
## The target and the feature
The target is VK.com. The feature is the geolocation tag on a photo: the ability to attach a place, stored as latitude and longitude, to a picture in a user's album. The report names two endpoints that serve this feature:
```text
https:/vk.com/al_places.php
http://vk.com/al_photos.php
```
The report names both endpoints as part of the feature. Notice that both are written with a single slash after `https:` or `http:` in the report; that is how they appear in the text.
The researcher also refers to "the code of Oleg" that every VK user has in their album. The report does not explain what "the code of Oleg" refers to. The report treats it as something present on every user's page.
## Setup
No special accounts, roles or tools are described. The only precondition is that the attacker knows the identifier of a target photo, which is visible in the photo's URL. The researcher gives the example `307707832_367700640`, a pair of numbers in the form `owner_photo`.
That pair is the key to everything that follows: it is public, it appears in the address bar whenever a photo is open, and it is enough to ask VK about that photo.
## Finding it
The researcher states that a hash is stored in the open and that, with the right request, a geolocation mark can be placed on any user's photo. In their words this is already "some kind of hacking". The summary at the top of the report says the same in one line: the vulnerability lets you put a geolocation mark on a photo for any user.
The important observation is not a clever trick but a missing restriction. The page that produces the hash can be requested with a photo identifier, and the hash is found in the page source. Because the answer is written into the page source, anyone who can load the page can read the secret.
## Exploitation
The researcher breaks the attack into four steps. Each one is small; together they form a chain from a public photo link to a mark on a stranger's picture.
### Step 1: pick a photo and copy its identifier
Choose any user, choose any of their photos, and copy part of the photo link, for example:
```text
307707832_367700640
```
Why this step: the identifier is the only thing the later requests need in order to name the target. It is not secret, because it sits in the address of the photo page, so copying it costs nothing.
### Step 2: fetch the page that contains the photo hash
The researcher uses the following URL to obtain the hash of a user's photo:
```text
https:/vk.com/al_places.php?act=show_photo_place&al=1&edit=1&photo=ХХХХ_ХХ
```
Here `ХХХХ_ХХ` is the photo identifier in the form shown above. A concrete request is:
```text
https:/vk.com/al_places.php?act=show_photo_place&al=1&edit=1&photo=307707832_367700640
```
Line by line, in plain words:
- `https:/vk.com/al_places.php` is the endpoint that deals with places on photos.
- `act=show_photo_place` tells it which action to run: show the place information for a photo.
- `al=1` and `edit=1` are flags the researcher includes; the report does not explain what they switch on, only that they are part of the working request.
- `photo=307707832_367700640` names the photo, using the identifier copied in step 1.
Why this step: the hash is not something you can guess. It has to be obtained from VK, and this page is where VK puts it. The researcher then views the page source and finds the hash there. Viewing the source is the whole technique: the secret is not protected, it is merely printed in a place most people never look.
### Step 3: send the request that creates the place mark
With the hash in hand, the researcher uses this URL to create a mark on the photo:
```text
http://vk.com/al_photos.php?act=do_edit_place&al=1&hash=ТУТХЕШ&lat=0.7031073524364909&long=16.875&photo=ТУТФОТОФОРМАТА�
�
�
_�
�
�
```
A concrete request is:
```text
http://vk.com/al_photos.php?act=do_edit_place&al=1&hash=0268f5b2baab24d032&lat=0.7031073524364909&long=16.875&photo=307707832_367700640
```
Line by line:
- `http://vk.com/al_photos.php` is the endpoint that edits photos.
- `act=do_edit_place` selects the action that saves a place on a photo.
- `al=1` is kept from the previous request.
- `hash=0268f5b2baab24d032` carries the value taken from the page in step 2. This is the cloakroom ticket.
- `lat=0.7031073524364909` and `long=16.875` are the coordinates of the place to be attached.
- `photo=307707832_367700640` names the photo again, so the server knows which picture to change.
According to the researcher, an error is returned. That sounds like failure, but it is the interesting part: the mark nevertheless appears if the user who owns the photo opens the link. So the attacker sends the link to the victim, the victim opens it, and the mark is created.
The report says an error is returned, but the mark appears if the photo's owner opens the link. When the attacker opens the link, the attacker is not the owner, so the request fails. When the owner opens it, the request succeeds. The attacker's job is therefore not to perform the edit but to make the owner perform it.
### Step 4: hide the request from the victim
To keep the victim from noticing, the researcher suggests building a page that contains an iframe with the link inside it, plus code that redirects to vk.com after, for example, five seconds. The page is hosted somewhere on the internet and sent to the user; the user opens it, is sent back to VK, and suspects nothing.
The researcher suggests an iframe with the link plus a delayed redirect to vk.com. The redirect then moves the browser to VK, so the victim sees an ordinary VK page and has no reason to think anything happened.
The researcher also notes that the video shows, at the beginning, that Oleg forgot his album on users' pages.
{{media:0}}
The video is the demonstration of the whole flow; the researcher uploaded the original to Yandex Disk and YouTube and gives both links.
## Root cause
The hash needed to perform the edit is exposed on a page that can be requested for any photo, so the attacker can obtain it without owning the photo. The edit endpoint then accepts the request without checking that the photo belongs to the caller. The researcher's own diagnosis is that the ownership check on the photo is missing from the method, and their suggested fix is to add it as an `if else` check.
In everyday terms: the hash is exposed, and the researcher says the ownership check on the photo is missing.
## Impact
An attacker can place a geolocation mark on any user's photo, provided the attacker knows the photo identifier and the victim opens the crafted link. The mark is created in the context of the victim's session, which is why the request returns an error to the attacker but succeeds when the owner opens it.
It is worth being precise about how small the impact looks and why it still matters. A wrong place on a photo is not a password leak.
## Fix
The researcher's recommendation is to add a check that the photo belongs to the user inside the method, expressed as an `if else`.
## Variants to test
These are follow-up checks based on the report's steps.
1. Request the page that exposes the hash for photos belonging to other accounts and look for a hash in the response. A positive result is a hash that the edit endpoint later accepts.
2. Send the edit request from an account that does not own the photo and observe whether the action is rejected or silently deferred to the owner's session. A positive result is a mark appearing after the owner opens the link.
3. Wrap the edit link in an iframe on a third-party page with a delayed redirect, as the researcher describes, and check whether the mark is created without any visible prompt. A positive result is a mark on the photo with no interaction beyond loading the page.
## Hunting notes
This kind of bug hides in AJAX-style endpoints that return editing material, such as a hash or token, for objects the caller does not own, and in the companion endpoint that consumes that material. During recon, look for `al_*.php` style handlers with `act=` parameters that both read and write object state, and check whether the read side is scoped to the owner. The signal is a read endpoint that happily returns a per-object secret for an arbitrary object identifier taken from a public URL. The researcher showed impact by demonstrating the full chain, from reading the hash to the mark appearing on the victim's photo after the victim opened the link, which is what made the report actionable.
## Glossary
- **API**: a defined way for software to talk to a server by sending requests with named parameters and receiving data or an action in return.
- **Bounty**: a payment a company makes to a researcher who reports a valid security problem.
- **Code injection**: a class of weakness where input the attacker controls is accepted and acted on by the server as a legitimate instruction.
- **Cookie**: a small piece of data a site stores in your browser and receives back with each request, used to recognise you.
- **Endpoint**: a specific address on a server that performs one job, such as showing data or saving a change.
- **Hash (in this report)**: a short secret string issued by the server and checked later to authorise a request, like a cloakroom ticket.
- **HTML**: the text language web pages are written in, which your browser reads and displays.
- **Identifier (`owner_photo`)**: the pair of numbers in a photo's URL that names the photo, for example `307707832_367700640`.
- **Iframe**: a window inside a web page that loads another page, so the inner page loads when the outer one does.
- **Latitude and longitude**: the two numbers that describe a point on the Earth's surface, used here to store a place on a photo.
- **Parameter**: a `name=value` pair after the `?` in a URL that tells the server what you want.
- **Redirect**: an instruction that sends the browser to another address automatically, sometimes after a delay.
- **Recon**: the information-gathering phase of security testing, before attempting an attack.
- **Session**: the state that ties your requests together after you log in, so the server knows who you are.
- **Source (page source)**: the raw HTML text of a page, which you can view in the browser and which may contain values not shown on screen.
- **Token**: a value issued by a server and presented back to prove a request is allowed, the same role the hash plays here.
- **URL**: the address of a page or endpoint, including any parameters after the `?`.
- **Vulnerability**: a weakness in software that lets someone make it behave in a way its owners did not intend.
One user can read or change another user's data, usually by changing an identifier the server trusts without checking who is asking. One of the most paid bug classes on web programs.