{"record":{"id":"dfce3f1030761484","repo":"sqlmapproject/sqlmap","slug":"invalid-choice","errorCode":null,"errorMessage":"invalid choice","messagePattern":"invalid choice","errorType":"validation","errorClass":"SqlmapValueException","httpStatus":null,"severity":"error","filePath":"lib/controller/controller.py","lineNumber":145,"sourceCode":"\n                message += \"[%d] place: %s, parameter: \" % (i, place)\n                message += \"%s, type: %s\" % (parameter, ptype)\n\n                if i == 0:\n                    message += \" (default)\"\n\n                message += \"\\n\"\n\n        message += \"[q] Quit\"\n        choice = readInput(message, default='0').upper()\n\n        if isDigit(choice) and int(choice) < len(kb.injections) and int(choice) >= 0:\n            index = int(choice)\n        elif choice == 'Q':\n            raise SqlmapUserQuitException\n        else:\n            errMsg = \"invalid choice\"\n            raise SqlmapValueException(errMsg)\n\n        kb.injection = kb.injections[index]\n\ndef _formatInjection(inj):\n    paramType = conf.method if conf.method not in (None, HTTPMETHOD.GET, HTTPMETHOD.POST) else inj.place\n    data = \"Parameter: %s (%s)\\n\" % (inj.parameter, paramType)\n\n    for stype, sdata in inj.data.items():\n        title = sdata.title\n        vector = sdata.vector\n        comment = sdata.comment\n        payload = agent.adjustLateValues(sdata.payload)\n        if inj.place == PLACE.CUSTOM_HEADER:\n            payload = payload.split(',', 1)[1]\n        if stype == PAYLOAD.TECHNIQUE.UNION:\n            count = re.sub(r\"(?i)(\\(.+\\))|(\\blimit[^a-z]+)\", \"\", sdata.payload).count(',') + 1\n            title = re.sub(r\"\\d+ to \\d+\", str(count), title)\n            vector = agent.forgeUnionQuery(\"[QUERY]\", vector[0], vector[1], vector[2], None, None, vector[5], vector[6])","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/sqlmapproject/sqlmap/blob/0a35b20e3953d341be6c7ac75ccb0b3362540c8d/lib/controller/controller.py#L127-L163","documentation":"_selectInjection prompts the user to pick which of multiple detected injection points to use; the entered choice was neither a valid index into kb.injections nor 'Q' to quit, so this SqlmapValueException is raised. It is a guard around interactive menu input, not a target-side failure.","triggerScenarios":"Thrown at lib/controller/controller.py:145 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Re-run and enter a listed numeric choice or 'Q' to quit.","Use -- answers or the batch mode to avoid interactive selection entirely.","Pick the default (0) to use the first injection point.","If indices appear wrong, re-run detection so kb.injections is rebuilt consistently."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0a35b20e3953d341be6c7ac75ccb0b3362540c8d","analyzedAt":"2026-08-26T23:02:52.002Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}