Skip to content

Commit

Permalink
"Spell-Jacking" mitigation ~ prevent sensitive data leak from spell c…
Browse files Browse the repository at this point in the history
  • Loading branch information
dlehammer and Daniel Hammer committed Feb 6, 2023
1 parent 9d459fb commit fc8462d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
2 changes: 2 additions & 0 deletions ui/src/layout/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ const FormLogin = ({ loading, handleSubmit, validate }) => {
component={renderInput}
label={translate('ra.auth.username')}
disabled={loading}
spellCheck={false}
/>
</div>
<div className={classes.input}>
Expand Down Expand Up @@ -201,6 +202,7 @@ const FormSignUp = ({ loading, handleSubmit, validate }) => {
component={renderInput}
label={translate('ra.auth.username')}
disabled={loading}
spellCheck={false}
/>
</div>
<div className={classes.input}>
Expand Down
14 changes: 11 additions & 3 deletions ui/src/user/UserCreate.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,18 @@ const UserCreate = (props) => {
return (
<Create title={<Title subTitle={title} />} {...props}>
<SimpleForm save={save} variant={'outlined'}>
<TextInput source="userName" validate={[required()]} />
<TextInput
spellCheck={false}
source="userName"
validate={[required()]}
/>
<TextInput source="name" validate={[required()]} />
<TextInput source="email" validate={[email()]} />
<PasswordInput source="password" validate={[required()]} />
<TextInput spellCheck={false} source="email" validate={[email()]} />
<PasswordInput
spellCheck={false}
source="password"
validate={[required()]}
/>
<BooleanInput source="isAdmin" defaultValue={false} />
</SimpleForm>
</Create>
Expand Down
18 changes: 14 additions & 4 deletions ui/src/user/UserEdit.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,22 +108,32 @@ const UserEdit = (props) => {
save={save}
>
{permissions === 'admin' && (
<TextInput source="userName" validate={[required()]} />
<TextInput
spellCheck={false}
source="userName"
validate={[required()]}
/>
)}
<TextInput
source="name"
validate={[required()]}
{...getNameHelperText()}
/>
<TextInput source="email" validate={[email()]} />
<TextInput spellCheck={false} source="email" validate={[email()]} />
<BooleanInput source="changePassword" />
<FormDataConsumer>
{(formDataProps) => (
<CurrentPasswordInput isMyself={isMyself} {...formDataProps} />
<CurrentPasswordInput
spellCheck={false}
isMyself={isMyself}
{...formDataProps}
/>
)}
</FormDataConsumer>
<FormDataConsumer>
{(formDataProps) => <NewPasswordInput {...formDataProps} />}
{(formDataProps) => (
<NewPasswordInput spellCheck={false} {...formDataProps} />
)}
</FormDataConsumer>

{permissions === 'admin' && (
Expand Down

0 comments on commit fc8462d

Please sign in to comment.