private static void setGlobalSerializationFilter() throws IOException {

		// NOTE: Serialization filter may need to be disabled when profiling with VisualVM
		String disabledStr = System.getProperty(SERIALIZATION_FILTER_DISABLED_PROPERTY);
		if (Boolean.valueOf(disabledStr)) {
			return;
		}

		ObjectInputFilter patternFilter = readSerialFilterPatternFile();

		ObjectInputFilter filter = new ObjectInputFilter() {

			@Override
			public Status checkInput(FilterInfo info) {

				Class<?> clazz = info.serialClass();

				// Give serial filter patterns first shot
				Status status = patternFilter.checkInput(info);
				if (status != Status.UNDECIDED) {
					if (status == Status.REJECTED) {
						return serialReject(info, "failed by serial.filter pattern");
					}
					return status;
				}

				if (clazz == null) {
					return Status.ALLOWED;
				}

				Class<?> componentType = clazz.getComponentType();
				if (componentType != null && componentType.isPrimitive()) {
					return Status.ALLOWED; // allow all primitive arrays
				}

				return serialReject(info, "not allowed");
			}

			private Status serialReject(FilterInfo info, String reason) {
				String clientHost = RepositoryManager.getRMIClient();
				StringBuilder buf = new StringBuilder();
				buf.append("Rejected class serialization");
				if (clientHost != null) {
					buf.append(" from ");
					buf.append(clientHost);
				}
				buf.append("(");
				buf.append(reason);
				buf.append(")");

				Class<?> serialClass = info.serialClass();
				if (serialClass != null) {
					buf.append(": ");
					buf.append(serialClass.getCanonicalName());
					buf.append(" ");
					if (serialClass.getComponentType() != null) {
						buf.append("(");
						buf.append("array-length=");
						buf.append(info.arrayLength());
						buf.append(")");
					}
				}

				log.error(buf.toString());
				return Status.REJECTED;
			}

		};

		// Install global serial class filter
		ObjectInputFilter.Config.setSerialFilter(filter);
	}
Main method for starting the Ghidra server.

@param args  command line arguments
Ghidra/Features/GhidraServer/src/main/java/ghidra/server/remote/GhidraServer.java