CVE-2022-0088
📋 TL;DR
CVE-2022-0088 is a Cross-Site Request Forgery (CSRF) vulnerability in YOURLS URL shortener software versions prior to 1.8.3. This allows attackers to trick authenticated administrators into performing unintended actions by visiting malicious web pages. All YOURLS installations with admin access are affected.
💻 Affected Systems
- YOURLS (Your Own URL Shortener)
📦 What is this software?
Yourls by Yourls
⚠️ Risk & Real-World Impact
Worst Case
Complete takeover of the YOURLS instance through admin account compromise, allowing attackers to modify all URLs, change settings, or delete the installation.
Likely Case
Unauthorized URL creation, modification, or deletion by tricking an admin into clicking a malicious link while logged into YOURLS.
If Mitigated
No impact if proper CSRF tokens are implemented and validated for all state-changing actions.
🎯 Exploit Status
Exploitation requires the victim to be logged into YOURLS admin interface and visit a malicious page. Public proof-of-concept code is available.
🛠️ Fix & Mitigation
✅ Official Fix
Patch Version: 1.8.3
Vendor Advisory: https://github.com/yourls/yourls/commit/1de256d8694b0ec7d4df2ac1d5976d4055e09d59
Restart Required: No
Instructions:
1. Backup your YOURLS installation and database. 2. Download YOURLS 1.8.3 or later from GitHub. 3. Replace all files except user/config.php and user/plugins/. 4. Verify the installation works correctly.
🔧 Temporary Workarounds
Add CSRF Protection Headers
allImplement custom CSRF token validation for all admin actions
Modify YOURLS admin PHP files to include CSRF token checks on all POST requests
Restrict Admin Access
allLimit admin interface access to specific IP addresses or networks
Add IP restrictions in .htaccess or web server configuration for admin directory
🧯 If You Can't Patch
- Implement strict SameSite cookie policies for admin sessions
- Require re-authentication for all sensitive admin actions
🔍 How to Verify
Check if Vulnerable:
Check YOURLS version in admin interface or examine includes/version.php file for version number less than 1.8.3
Check Version:
grep "define( 'YOURLS_VERSION'," includes/version.php
Verify Fix Applied:
Verify version is 1.8.3 or higher and test that admin actions require valid CSRF tokens
📡 Detection & Monitoring
Log Indicators:
- Multiple failed admin actions from same IP
- Admin actions without proper referrer headers
- Unexpected URL creations or modifications
Network Indicators:
- HTTP POST requests to admin endpoints without CSRF tokens
- Requests with mismatched referrer headers
SIEM Query:
source="yourls_logs" AND (action="create" OR action="delete" OR action="update") AND csrf_token=""
🔗 References
- https://github.com/yourls/yourls/commit/1de256d8694b0ec7d4df2ac1d5976d4055e09d59
- https://huntr.dev/bounties/d01f0726-1a0f-4575-ae17-4b5319b11c29
- https://github.com/MarkLee131/awesome-web-pocs/blob/main/CVE-2022-0088.md
- https://github.com/yourls/yourls/commit/1de256d8694b0ec7d4df2ac1d5976d4055e09d59
- https://huntr.dev/bounties/d01f0726-1a0f-4575-ae17-4b5319b11c29