8000
Skip to content

GM_deleteValue and GM_listValues are not GM_apiLeakCheck:ed #1019

@arantius

Description

@arantius

Originally: DevjaVu ticket 246

Hostile content can list and delete stored (key;value) pairs.

From miscapis.js:

GM_ScriptStorage.prototype.deleteValue = function(name) {
  return this.prefMan.remove(name);
}

GM_ScriptStorage.prototype.listValues = function() {
  return this.prefMan.listValues();
}

Compare with:

GM_ScriptStorage.prototype.setValue = function(name, val) {
  if (!GM_apiLeakCheck("GM_setValue")) {
    return;
  }

  this.prefMan.setValue(name, val);
};

GM_ScriptStorage.prototype.getValue = function(name, defVal) {
  if (!GM_apiLeakCheck("GM_getValue")) {
    return;
  }

  return this.prefMan.getValue(name, defVal);
};

As a side note: listValues is a terrible name for a method that is actually enumerating keys, not values.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0