Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
our_own_cloud_project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
die_coolen_jungs
our_own_cloud_project
Commits
f5fe95a1
Commit
f5fe95a1
authored
12 years ago
by
Lukas Reschke
Browse files
Options
Downloads
Patches
Plain Diff
Removed sectoken
This token is completly useless since an attacker can easily extract it from the page.
parent
bd804b74
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
core/lostpassword/index.php
+4
-11
4 additions, 11 deletions
core/lostpassword/index.php
core/lostpassword/templates/lostpassword.php
+0
-1
0 additions, 1 deletion
core/lostpassword/templates/lostpassword.php
with
4 additions
and
12 deletions
core/lostpassword/index.php
+
4
−
11
View file @
f5fe95a1
...
...
@@ -16,7 +16,7 @@ if (isset($_POST['user'])) {
$token
=
sha1
(
$_POST
[
'user'
]
.
md5
(
uniqid
(
rand
(),
true
)));
OC_Preferences
::
setValue
(
$_POST
[
'user'
],
'owncloud'
,
'lostpassword'
,
$token
);
$email
=
OC_Preferences
::
getValue
(
$_POST
[
'user'
],
'settings'
,
'email'
,
''
);
if
(
!
empty
(
$email
)
and
isset
(
$_POST
[
'sectoken'
])
and
isset
(
$_SESSION
[
'sectoken'
])
and
(
$_POST
[
'sectoken'
]
==
$_SESSION
[
'sectoken'
])
)
{
if
(
!
empty
(
$email
))
{
$link
=
OC_Helper
::
linkToAbsolute
(
'core/lostpassword'
,
'resetpassword.php'
,
array
(
'user'
=>
$_POST
[
'user'
],
'token'
=>
$token
));
$tmpl
=
new
OC_Template
(
'core/lostpassword'
,
'email'
);
$tmpl
->
assign
(
'link'
,
$link
,
false
);
...
...
@@ -25,18 +25,11 @@ if (isset($_POST['user'])) {
$from
=
'lostpassword-noreply@'
.
OCP\Util
::
getServerHost
();
OC_MAIL
::
send
(
$email
,
$_POST
[
'user'
],
$l
->
t
(
'ownCloud password reset'
),
$msg
,
$from
,
'ownCloud'
);
echo
(
'sent'
);
}
$sectoken
=
rand
(
1000000
,
9999999
);
$_SESSION
[
'sectoken'
]
=
$sectoken
;
OC_Template
::
printGuestPage
(
'core/lostpassword'
,
'lostpassword'
,
array
(
'error'
=>
false
,
'requested'
=>
true
,
'sectoken'
=>
$sectoken
));
OC_Template
::
printGuestPage
(
'core/lostpassword'
,
'lostpassword'
,
array
(
'error'
=>
false
,
'requested'
=>
true
));
}
else
{
$sectoken
=
rand
(
1000000
,
9999999
);
$_SESSION
[
'sectoken'
]
=
$sectoken
;
OC_Template
::
printGuestPage
(
'core/lostpassword'
,
'lostpassword'
,
array
(
'error'
=>
true
,
'requested'
=>
false
,
'sectoken'
=>
$sectoken
));
OC_Template
::
printGuestPage
(
'core/lostpassword'
,
'lostpassword'
,
array
(
'error'
=>
true
,
'requested'
=>
false
));
}
}
else
{
$sectoken
=
rand
(
1000000
,
9999999
);
$_SESSION
[
'sectoken'
]
=
$sectoken
;
OC_Template
::
printGuestPage
(
'core/lostpassword'
,
'lostpassword'
,
array
(
'error'
=>
false
,
'requested'
=>
false
,
'sectoken'
=>
$sectoken
));
OC_Template
::
printGuestPage
(
'core/lostpassword'
,
'lostpassword'
,
array
(
'error'
=>
false
,
'requested'
=>
false
));
}
This diff is collapsed.
Click to expand it.
core/lostpassword/templates/lostpassword.php
+
0
−
1
View file @
f5fe95a1
...
...
@@ -10,7 +10,6 @@
<p
class=
"infield"
>
<label
for=
"user"
class=
"infield"
>
<?php
echo
$l
->
t
(
'Username'
);
?>
</label>
<input
type=
"text"
name=
"user"
id=
"user"
value=
""
autocomplete=
"off"
required
autofocus
/>
<input
type=
"hidden"
name=
"sectoken"
id=
"sectoken"
value=
"
<?php
echo
(
$_
[
'sectoken'
]);
?>
"
/>
</p>
<input
type=
"submit"
id=
"submit"
value=
"
<?php
echo
$l
->
t
(
'Request reset'
);
?>
"
/>
<?php
endif
;
?>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment