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

XSS vulnerabilities due to lack of input/output escaping/sanitisation #27

Open
samaloney opened this issue Nov 10, 2022 · 0 comments
Open

Comments

@samaloney
Copy link
Contributor

A number of old and new reports on for example this one https://www.openbugbounty.org/reports/3046054/ there is a list of older report at the bottom of the page.

Possible non exclusive solutions:

  1. There are not that many supported query string parameters, date, region, type, indexnum, ... most of which are parsed out in one place if they can be sanitise at this point that may resolve a many of the issues. The code below seem to parse/set many of these
    $arm_data_path = "";
    if (isset($_GET['region']) && !isset($_GET['date']))
    {
    $region = $_GET['region'];
    $date_use = arsql_search($region);
    if ($date_use == "00000000")
    {
    print "***no date";
    }
    else
    {
    $date = date("Ymd",strtotime($date_use));
    if (!isset($_GET['type']))
    header("Location: index.php?date=$date&region=$region");
    }
    }
    elseif (!isset($_GET['region']) && isset($_GET['date']))
    {
    $date = $_GET['date'];
    $region = '';
    }
    elseif (isset($_GET['region']) && isset($_GET['date']))
    {
    $date = $_GET['date'];
    $region = $_GET['region'];
    }
    else
    {
    $date = gmdate("Ymd");
    $region = '';
    }
  2. Find and appropriately escape/sanitise all output of variables obtained from the query string. A random example I pulled out
    if ($mode != 'prob')
    print(" <area shape=\"circle\" coords=\"$coor1,$coor2,35\" href=JavaScript:RegionZoom(\"./region_pop.php?date=$date&type=$type&region=$region\")>\n");
    else
    print(" <area shape=\"circle\" coords=\"$coor1,$coor2,35\" href=JavaScript:RegionZoom(\"./region_pop_prob.php?date=$date&type=$type&region=$region\")>\n");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant