Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Client-Side CSRF/SSRF from gisweb.azureedge.net response #274

Open
emanuelb opened this issue Aug 4, 2020 · 0 comments
Open

Client-Side CSRF/SSRF from gisweb.azureedge.net response #274

emanuelb opened this issue Aug 4, 2020 · 0 comments

Comments

@emanuelb
Copy link

emanuelb commented Aug 4, 2020

Here the response of request to https://gisweb.azureedge.net/get_config.json?r=${Math.random()} (assumed json is returned) will be stored in configUrls variable, which some data in the json configUrls.data[env] is passed to downloadAndVerifySigning function, that will use without verification and whitelisted domains as input to axios.get('${url}.sign?r=${Math.random()}' command.

const configUrls = await axios.get(`https://gisweb.azureedge.net/get_config.json?r=${Math.random()}`, { headers: { 'Content-Type': 'application/json;charset=utf-8' } });
const data = await downloadAndVerifySigning(configUrls.data[env]);

export const downloadAndVerifySigning = (url: string) => new Promise<any>(async (resolve, reject) => {
try {
const { data }: { data: string } = await axios.get(`${url}.sign?r=${Math.random()}`, { headers: { 'Content-Type': 'application/json;charset=utf-8' } });

thus the server can return any URIs (not just https:// but http:// as well, for any domain, such as: http://192.168.1.1 to attack local network resources, such as routers, etc...)

the .sign?r= addition is easily bypassed/ignored by adding # or &x= to the url (it will be part of the hash or additional parameter)

fix: implement white-list in the application of allowed hosts (only in https:// protocol) that can be used in the request for the signed data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant