Select element client side modification?
<p>I use tools like Firebug pretty routinely, and often build SPA style dynamic forms where DOM manipulation with user inputs is routine. Are there any safeguards against a user inserting options into a select box using a tool like Firebug or any sort of javascript CLI?</p>

<p>As a simple example, consider this select box for you to choose whether you are married or unmarried (My actual select boxes have MANY more options, and are populated via AJAX from XML files. This will be important later.):</p>

<pre><code>&lt;select name="mstatus" id="mstatus"&gt;
    &lt;option value="" selected&gt;Specify marital status&lt;/option&gt;
    &lt;option value="Married"&gt;Married&lt;/option&gt;
    &lt;option value="Single"&gt;Single&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p>Currently I can easily insert another option thusly (I have Mootools on the page):</p>

<pre><code>$('mstatus').innerHTML+="&lt;option value='Rebel'&gt;I won't play by the rules&lt;/option&gt;"
</code></pre>

<p>Now of course for this example, I can check server side whether the selected option is valid without too much grief. But generally I would have to compare the user submission to the original XML source for each select in order to confirm its validity. </p>

<p>Is there another way to ensure the integrity of returned values? Is this enough of a non issue for me to take user selection at face value? Is the best practice here really just to treat all select inputs as text inputs until you have confirmed they are selected from within their valid range of values?</p>

<p>Thanks for your help.</p>

<p>Note: There is no danger of code injection, since all values entered are thoroughly vetted and are pretty inert by the time they get popped into the database.</p>
